From d4881b4b36d05f29ad39534ff3c605ca878a7a9a Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Fri, 10 Mar 2017 18:30:49 +0100 Subject: [PATCH] Ticket #3983: move instance tagging after elastic ip also always wait for the instance to leave pending (cherry picked from commit 5d8555b286ce97c711b9a9829cf6e936b0786279) --- src/vmm_mad/remotes/ec2/ec2_driver.rb | 28 +++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/vmm_mad/remotes/ec2/ec2_driver.rb b/src/vmm_mad/remotes/ec2/ec2_driver.rb index 7223012df0..0a66997e38 100755 --- a/src/vmm_mad/remotes/ec2/ec2_driver.rb +++ b/src/vmm_mad/remotes/ec2/ec2_driver.rb @@ -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)