From: mirabal Date: Thu, 18 May 2017 12:16:26 +0000 (+0200) Subject: Fix bug, check VF is active before destroy X-Git-Tag: v2.0.1~9 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=007797e7f8254028ccfa7a9959c4fe8e4a9b1a14;p=osm%2Fopenvim.git Fix bug, check VF is active before destroy Change-Id: Id589ab96fad5a4c1af876e03a0f27586b2af7695 Signed-off-by: mirabal --- 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: