@@ -69,7 +69,7 @@ def stop_vpc_instances():
69
69
instance_id = instance ['id' ]
70
70
instance_name = instance ['name' ]
71
71
if instance_name not in ignore_group :
72
- print (f"Stopping instance { instance_id } " )
72
+ print (f"Stopping instance { instance_name } " )
73
73
response = client .create_instance_action (instance_id = instance_id , type = 'stop' ).get_result ()
74
74
logging .info (response )
75
75
except ApiException as e :
@@ -88,19 +88,19 @@ def start_vpc_instances():
88
88
for instance in list_instances :
89
89
instance_id = instance ['id' ]
90
90
instance_name = instance ['name' ]
91
- if instance_name not in ignore_group :
92
- print (f"Starting instance { instance_id } " )
93
- response = client .create_instance_action (instance_id = instance_id , type = 'start' ).get_result ()
94
- logging .info (response )
91
+
92
+ print (f"Starting instance { instance_name } " )
93
+ response = client .create_instance_action (instance_id = instance_id , type = 'start' ).get_result ()
94
+ logging .info (response )
95
95
96
- while True :
97
- instance_status = client .get_instance (id = instance_id ).get_result ()['status' ]
98
- if instance_status == 'running' :
99
- logging .info (f"Instance { instance_id } is now running" )
100
- break
101
- else :
102
- logging .info (f"Instance { instance_id } status: { instance_status } . Waiting..." )
103
- time .sleep (5 )
96
+ while True :
97
+ instance_status = client .get_instance (id = instance_id ).get_result ()['status' ]
98
+ if instance_status == 'running' :
99
+ logging .info (f"Instance { instance_id } is now running" )
100
+ break
101
+ else :
102
+ logging .info (f"Instance { instance_id } status: { instance_status } . Waiting..." )
103
+ time .sleep (5 )
104
104
except ApiException as e :
105
105
print ("Failed to start instances: %s\n " % e )
106
106
0 commit comments