From fe8bc32be90f0c2b27cf69b2805cce211b8f8c94 Mon Sep 17 00:00:00 2001 From: Li Ma Date: Sat, 14 Jan 2017 15:23:38 +0800 Subject: [PATCH] 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 --- dragonflow/cmd/eventlet/df_metadata_service.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dragonflow/cmd/eventlet/df_metadata_service.py b/dragonflow/cmd/eventlet/df_metadata_service.py index 925675de4..126ae4681 100644 --- a/dragonflow/cmd/eventlet/df_metadata_service.py +++ b/dragonflow/cmd/eventlet/df_metadata_service.py @@ -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"]