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

Ticket #3983: move tagging back to previous position

ONE_ID tagging is done after pending state change

(cherry picked from commit 429262592a1581e8bb3522bcaf89a6ae2be53cab)
This commit is contained in:
Javi Fontan 2017-03-13 12:25:36 +01:00
parent d4881b4b36
commit 6afb1ea097

View File

@ -325,6 +325,18 @@ class EC2Driver
sleep 2
end
tags = generate_options(:tags, ec2_info)[:tags] || {}
tag_array = []
tags.each{ |key,value|
tag_array << {
:key => key,
:value => value
}
}
instance.create_tags(:tags => tag_array)
elastic_ip = ec2_value(ec2_info, 'ELASTICIP')
if elastic_ip
@ -346,19 +358,10 @@ class EC2Driver
wait_state('running', instance.id)
tags = generate_options(:tags, ec2_info)[:tags] || {}
tags['ONE_ID'] = id
tag_array = []
tags.each{ |key,value|
tag_array << {
:key => key,
:value => value
}
}
instance.create_tags(:tags => tag_array)
instance.create_tags(tags: [{
key: 'ONE_ID',
value: id
}])
puts(instance.id)
else