@@ -1329,7 +1329,8 @@ def delete_cloud_instance(configuration, client_id, cloud_id, cloud_flavor,
1329
1329
cloud_id = 'MIST2'
1330
1330
cloud_flavor = 'openstack'
1331
1331
instance_id = 'My-Misty-Test-42'
1332
- instance_image = 'cirrossdk'
1332
+ #instance_image = 'cirrossdk'
1333
+ instance_image = 'Cirros Test Image'
1333
1334
1334
1335
reuse_instance = False
1335
1336
restart_instance = False
@@ -1355,14 +1356,18 @@ def delete_cloud_instance(configuration, client_id, cloud_id, cloud_flavor,
1355
1356
# TODO: load yaml from custom location or inline
1356
1357
print ("calling cloud operations for %s in %s with instance %s" %
1357
1358
(client_id , cloud_id , instance_id ))
1358
- img_list = list_cloud_images (conf , client_id , cloud_id , cloud_flavor )
1359
+ (img_status , img_list ) = list_cloud_images (conf , client_id , cloud_id ,
1360
+ cloud_flavor )
1359
1361
print (img_list )
1360
1362
image_id = ''
1361
1363
for (img_name , img_id , img_alias ) in img_list :
1362
1364
if instance_image == img_name :
1363
1365
image_id = img_id
1364
1366
1365
1367
if not reuse_instance :
1368
+ if not image_id :
1369
+ print ("Warning: request new instance but img %r not found on %r" %
1370
+ (instance_image , cloud_id ))
1366
1371
print (create_cloud_instance (conf , client_id , cloud_id , cloud_flavor ,
1367
1372
instance_id , image_id , auth_keys ))
1368
1373
# Start happens automatically on create
0 commit comments