pat.py catches nova exceptions on dead servers.

This commit is contained in:
Pino de Candia 2018-01-22 16:08:43 +00:00
parent 0d456cc116
commit a061c474c2
2 changed files with 5 additions and 2 deletions

View File

@ -196,7 +196,7 @@ class HostCerts(object):
except KeyError as e:
raise falcon.HTTPBadRequest(str(e))
resp.body = hostToJson(host)
resp.status = falcon.HTTP_201
resp.status = falcon.HTTP_200
resp.location = '/hostcerts/' + host.host_id + '/' + host.fingerprint
@falcon.before(validate)

View File

@ -88,7 +88,10 @@ def get_port_ip_tuples(instance_id, fixed_lport):
port_ip_tuples = []
all_entries = DRAGONFLOW.get_all(PATEntry)
LOG.debug('Found {} PATEntries: {}'.format(len(all_entries), all_entries))
server = NOVA.servers.get(instance_id)
try:
server = NOVA.servers.get(instance_id)
except:
return []
ifaces = server.interface_list()
for iface in ifaces:
lport = DRAGONFLOW.get(LogicalPort(id=iface.port_id))