Fix the traceback when checking on stale ports (Kilo)
Change-Id: I2451ef79cc32cff5023bfbc8eaf56fddbff46ccb
This commit is contained in:
parent
0ccb558524
commit
6bd6115b5f
@ -203,11 +203,13 @@ class Network(object):
|
|||||||
# Assumed that both management networks are created together so checking for one of them
|
# Assumed that both management networks are created together so checking for one of them
|
||||||
ports = self.neutron_client.list_ports()['ports']
|
ports = self.neutron_client.list_ports()['ports']
|
||||||
for port in ports:
|
for port in ports:
|
||||||
port_ip = port['fixed_ips'][0]
|
# Skip the check on stale ports
|
||||||
if (port['device_id'] == self.ext_router['id']) and \
|
if port['fixed_ips']:
|
||||||
(port_ip['subnet_id'] == self.vm_int_net[0]['subnets'][0]):
|
port_ip = port['fixed_ips'][0]
|
||||||
print 'Ext router already associated to the internal network'
|
if (port['device_id'] == self.ext_router['id']) and \
|
||||||
return
|
(port_ip['subnet_id'] == self.vm_int_net[0]['subnets'][0]):
|
||||||
|
print 'Ext router already associated to the internal network'
|
||||||
|
return
|
||||||
|
|
||||||
for int_net in self.vm_int_net:
|
for int_net in self.vm_int_net:
|
||||||
body = {
|
body = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user