Add an exception around EIP fetching.

I was getting a traceback here causing the whole 'heat describe' to
return an error when really it was just the one aspect failing.  Use
try/rescue and log a warning.

Signed-off-by: Ian Main <imain@redhat.com>
This commit is contained in:
Ian Main 2012-04-20 11:38:59 -07:00
parent df5dee4e0b
commit 2f880bc61c
1 changed files with 5 additions and 2 deletions

View File

@ -307,8 +307,11 @@ class ElasticIp(Resource):
get the ipaddress here
'''
if self.instance_id != None:
ips = self.nova().floating_ips.get(self.instance_id)
self.ipaddress = ips.ip
try:
ips = self.nova().floating_ips.get(self.instance_id)
self.ipaddress = ips.ip
except Exception as ex:
logger.warn("Error getting floating IPs: %s" % str(ex))
Resource.reload(self)