Fix Exception on removal of Docker VM

Fix #441
This commit is contained in:
Julien Duponchelle 2016-02-24 15:04:45 +01:00
parent 057b637961
commit bbdbc971c0
No known key found for this signature in database
GPG Key ID: F1E2485547D4595D

View File

@ -454,6 +454,9 @@ class DockerVM(BaseVM):
:param adapter_number: adapter number :param adapter_number: adapter number
""" """
if not self._ubridge_hypervisor:
return
yield from self._ubridge_hypervisor.send("bridge delete bridge{name}".format( yield from self._ubridge_hypervisor.send("bridge delete bridge{name}".format(
name=adapter_number)) name=adapter_number))
@ -504,8 +507,7 @@ class DockerVM(BaseVM):
name=self.name, adapter_number=adapter_number)) name=self.name, adapter_number=adapter_number))
adapter.remove_nio(0) adapter.remove_nio(0)
if not self._ubridge_hypervisor: yield from self._delete_ubridge_connection(adapter_number)
yield from self._delete_ubridge_connection(adapter_number)
log.info( log.info(
"Docker VM '{name}' [{id}]: {nio} removed from adapter {adapter_number}".format( "Docker VM '{name}' [{id}]: {nio} removed from adapter {adapter_number}".format(