summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2019-02-04 19:23:09 +0000
committerGerrit Code Review <review@openstack.org>2019-02-04 19:23:10 +0000
commitf8f4b623ee54bda28c973650cd3a921b7a4d67ed (patch)
tree27bf77161ff957157f43c3d81588ee56f5708cf1
parent92d8637ef161aea9a87f068abff4041dfa70dbab (diff)
parentb328c6de45be693fd44397c11c73261cd20490e3 (diff)
Merge "EC2: Do not tag an instance until it is running"
-rw-r--r--nodepool/driver/aws/handler.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/nodepool/driver/aws/handler.py b/nodepool/driver/aws/handler.py
index c18f2f6..47da54d 100644
--- a/nodepool/driver/aws/handler.py
+++ b/nodepool/driver/aws/handler.py
@@ -49,8 +49,6 @@ class AwsInstanceLauncher(NodeLauncher):
49 attempts += 1 49 attempts += 1
50 time.sleep(1) 50 time.sleep(1)
51 51
52 instance.create_tags(Tags=[{'Key': 'nodepool_id',
53 'Value': str(self.node.id)}])
54 instance_id = instance.id 52 instance_id = instance.id
55 self.node.external_id = instance_id 53 self.node.external_id = instance_id
56 self.zk.storeNode(self.node) 54 self.zk.storeNode(self.node)
@@ -60,6 +58,8 @@ class AwsInstanceLauncher(NodeLauncher):
60 state = instance.state.get('Name') 58 state = instance.state.get('Name')
61 self.log.debug("Instance %s is %s" % (instance_id, state)) 59 self.log.debug("Instance %s is %s" % (instance_id, state))
62 if state == 'running': 60 if state == 'running':
61 instance.create_tags(Tags=[{'Key': 'nodepool_id',
62 'Value': str(self.node.id)}])
63 break 63 break
64 time.sleep(0.5) 64 time.sleep(0.5)
65 instance.reload() 65 instance.reload()