mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-21 14:50:08 +03:00
Ticket #3983: move instance tagging after elastic ip
also always wait for the instance to leave pending (cherry picked from commit 5d8555b286ce97c711b9a9829cf6e936b0786279)
This commit is contained in:
parent
e328e37481
commit
d4881b4b36
@ -325,20 +325,6 @@ class EC2Driver
|
||||
sleep 2
|
||||
end
|
||||
|
||||
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)
|
||||
|
||||
elastic_ip = ec2_value(ec2_info, 'ELASTICIP')
|
||||
|
||||
if elastic_ip
|
||||
@ -360,6 +346,20 @@ 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)
|
||||
|
||||
puts(instance.id)
|
||||
else
|
||||
restore(deploy_id)
|
||||
|
Loading…
x
Reference in New Issue
Block a user