1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-20 10:50:08 +03:00

M #-: add provision ID to all objects (#619)

This commit is contained in:
Alejandro Huertas Herrero 2021-01-12 10:42:38 +01:00 committed by Tino Vazquez
parent 4be3866596
commit 311f8da6cc
No known key found for this signature in database
GPG Key ID: 14201E424D02047E
2 changed files with 5 additions and 20 deletions

View File

@ -324,8 +324,6 @@ module OneProvision
self.state = STATE['RUNNING']
add_provision_id
update
self['ID']
@ -907,23 +905,6 @@ module OneProvision
end
end
# Add provision ID into objects template to improve search operations
def add_provision_id
objects.each do |key, value|
value.each do |obj|
resource = Resource.object(key)
resource.info(obj['id'])
if key != 'flowtemplates'
resource.one.update("PROVISION_ID=#{self['ID']}", true)
else
resource.one.update("{\"PROVISION_ID\":#{self['ID']}}",
true)
end
end
end
end
end
end

View File

@ -88,10 +88,14 @@ module OneProvision
# get new created image and update it with provision ID
@image = Image.new
p_id = @p_template['provision']['id']
@image.info(image_id)
@image.update_provision_info({ 'wait' => wait,
'wait_timeout' => timeout })
'wait_timeout' => timeout,
'id' => p_id })
@template.update_provision_info({ 'id' => p_id })
# Change permissions and ownership
@image.template_chown(@p_template)