pat.py catches nova exceptions on dead servers.
This commit is contained in:
parent
0d456cc116
commit
a061c474c2
@ -196,7 +196,7 @@ class HostCerts(object):
|
|||||||
except KeyError as e:
|
except KeyError as e:
|
||||||
raise falcon.HTTPBadRequest(str(e))
|
raise falcon.HTTPBadRequest(str(e))
|
||||||
resp.body = hostToJson(host)
|
resp.body = hostToJson(host)
|
||||||
resp.status = falcon.HTTP_201
|
resp.status = falcon.HTTP_200
|
||||||
resp.location = '/hostcerts/' + host.host_id + '/' + host.fingerprint
|
resp.location = '/hostcerts/' + host.host_id + '/' + host.fingerprint
|
||||||
|
|
||||||
@falcon.before(validate)
|
@falcon.before(validate)
|
||||||
|
@ -88,7 +88,10 @@ def get_port_ip_tuples(instance_id, fixed_lport):
|
|||||||
port_ip_tuples = []
|
port_ip_tuples = []
|
||||||
all_entries = DRAGONFLOW.get_all(PATEntry)
|
all_entries = DRAGONFLOW.get_all(PATEntry)
|
||||||
LOG.debug('Found {} PATEntries: {}'.format(len(all_entries), all_entries))
|
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()
|
ifaces = server.interface_list()
|
||||||
for iface in ifaces:
|
for iface in ifaces:
|
||||||
lport = DRAGONFLOW.get(LogicalPort(id=iface.port_id))
|
lport = DRAGONFLOW.get(LogicalPort(id=iface.port_id))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user