Delete the tap-metadata device when it exists in the system

The existing tap-metadata device causes failure of service
startup. We first check its existance and re-initialize the
environment when necessary.

Change-Id: I9d6f1262909ee461e5891a023f7394565a12f91b
Closes-Bug: #1656500
This commit is contained in:
Li Ma 2017-01-14 15:23:38 +08:00 committed by Omer Anson
parent 013b7e34fb
commit fe8bc32be9
1 changed files with 3 additions and 1 deletions

View File

@ -35,7 +35,9 @@ def environment_setup():
interface = cfg.CONF.df.metadata_interface
if ip_lib.device_exists(interface):
LOG.info(_LI("Device %s already exists"), interface)
return
# Destroy the environment when the device exists.
# We can re-initialize the environment correctly.
environment_destroy()
cmd = ["ovs-vsctl", "add-port", bridge, interface,
"--", "set", "Interface", interface, "type=internal"]