From 007797e7f8254028ccfa7a9959c4fe8e4a9b1a14 Mon Sep 17 00:00:00 2001 From: mirabal Date: Thu, 18 May 2017 14:16:26 +0200 Subject: [PATCH] Fix bug, check VF is active before destroy Change-Id: Id589ab96fad5a4c1af876e03a0f27586b2af7695 Signed-off-by: mirabal --- osm_openvim/host_thread.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osm_openvim/host_thread.py b/osm_openvim/host_thread.py index 1f8fdb4..80d9986 100644 --- a/osm_openvim/host_thread.py +++ b/osm_openvim/host_thread.py @@ -1901,7 +1901,8 @@ class host_thread(threading.Thread): #TODO.Revise self.server_forceoff(True) iface = conn.interfaceLookupByMACString(mac) - iface.destroy() + if iface.isActive(): + iface.destroy() iface.create() self.logger.debug("restore_iface '%s' %s", name, mac) except host_thread.lvirt_module.libvirtError as e: -- 2.25.1