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:
parent
ea2926228a
commit
ffe5dbf571
@ -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
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user