Browse Source

Merge "EC2: Do not tag an instance until it is running"

tags/3.5.0
Zuul 6 months ago
parent
commit
f8f4b623ee
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      nodepool/driver/aws/handler.py

+ 2
- 2
nodepool/driver/aws/handler.py View File

@@ -49,8 +49,6 @@ class AwsInstanceLauncher(NodeLauncher):
49 49
                 attempts += 1
50 50
             time.sleep(1)
51 51
 
52
-        instance.create_tags(Tags=[{'Key': 'nodepool_id',
53
-                                    'Value': str(self.node.id)}])
54 52
         instance_id = instance.id
55 53
         self.node.external_id = instance_id
56 54
         self.zk.storeNode(self.node)
@@ -60,6 +58,8 @@ class AwsInstanceLauncher(NodeLauncher):
60 58
             state = instance.state.get('Name')
61 59
             self.log.debug("Instance %s is %s" % (instance_id, state))
62 60
             if state == 'running':
61
+                instance.create_tags(Tags=[{'Key': 'nodepool_id',
62
+                                            'Value': str(self.node.id)}])
63 63
                 break
64 64
             time.sleep(0.5)
65 65
             instance.reload()

Loading…
Cancel
Save