Check container_id when disconnecting its network
The field 'container_id' is not always available (i.e. it is None if the container failed to create in Docker). We need to check it before disconnecting this container. Change-Id: I497a171548b5382abdde29160c43c9f4b10972c6
This commit is contained in:
@@ -299,8 +299,9 @@ class KuryrNetwork(network.Network):
|
||||
neutron_ports.add(port_id)
|
||||
|
||||
try:
|
||||
self.docker.disconnect_container_from_network(container_id,
|
||||
network_name)
|
||||
if container_id:
|
||||
self.docker.disconnect_container_from_network(container_id,
|
||||
network_name)
|
||||
finally:
|
||||
for port_id in all_ports:
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user