Skip to content

Commit abac3ad

Browse files
committed
fix API error in cloud inline self-test
git-svn-id: svn+ssh://svn.code.sf.net/p/migrid/code/trunk@6120 b75ad72c-e7d7-11dd-a971-7dbc132099af
1 parent a5459ca commit abac3ad

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

mig/shared/cloud.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1329,7 +1329,8 @@ def delete_cloud_instance(configuration, client_id, cloud_id, cloud_flavor,
13291329
cloud_id = 'MIST2'
13301330
cloud_flavor = 'openstack'
13311331
instance_id = 'My-Misty-Test-42'
1332-
instance_image = 'cirrossdk'
1332+
#instance_image = 'cirrossdk'
1333+
instance_image = 'Cirros Test Image'
13331334

13341335
reuse_instance = False
13351336
restart_instance = False
@@ -1355,14 +1356,18 @@ def delete_cloud_instance(configuration, client_id, cloud_id, cloud_flavor,
13551356
# TODO: load yaml from custom location or inline
13561357
print("calling cloud operations for %s in %s with instance %s" %
13571358
(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)
13591361
print(img_list)
13601362
image_id = ''
13611363
for (img_name, img_id, img_alias) in img_list:
13621364
if instance_image == img_name:
13631365
image_id = img_id
13641366

13651367
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))
13661371
print(create_cloud_instance(conf, client_id, cloud_id, cloud_flavor,
13671372
instance_id, image_id, auth_keys))
13681373
# Start happens automatically on create

0 commit comments

Comments
 (0)