Skip to content

Commit 87d017e

Browse files
committed
work-around an issue discovered in recent tests with upgraded openstack client cloud access
git-svn-id: svn+ssh://svn.code.sf.net/p/migrid/code/trunk@6123 b75ad72c-e7d7-11dd-a971-7dbc132099af
1 parent 68f9ae8 commit 87d017e

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

mig/shared/cloud.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -712,8 +712,17 @@ def openstack_create_cloud_instance(configuration, client_id, cloud_id,
712712
return (status, msg)
713713

714714
# Add floating IP to instance
715-
conn.compute.add_floating_ip_to_server(
716-
instance.id, floating_ip.floating_ip_address)
715+
try:
716+
conn.compute.add_floating_ip_to_server(
717+
instance.id, floating_ip.floating_ip_address)
718+
except openstack.exceptions.ResourceNotFound as rnf:
719+
# TODO: investigate if this apparently stray warning can be avoided
720+
# Try to proceed here as we seem to hit bogus warning here on
721+
# recent versions. We WILL bail out below if floating_ip_address
722+
# was not set.
723+
_logger.warning("%s ignore warning attaching floating ip: %s" %
724+
(instance.id, rnf))
725+
717726
if not floating_ip.floating_ip_address:
718727
status = False
719728
msg = force_native_str("%s" % floating_ip.floating_ip_address)

0 commit comments

Comments
 (0)