When trying to delete a VLAN tagging bridged network I got the following
error because of the VLAN bridge was not active.
[26/Dec/2014:16:28:42] HTTP Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/cherrypy/_cprequest.py", line 670, in
respond
response.body = self.handler()
File "/usr/lib/python2.7/dist-packages/cherrypy/lib/encoding.py", line 217, in
__call__
self.body = self.oldhandler(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/cherrypy/_cpdispatch.py", line 61, in
__call__
return self.callable(*self.args, **self.kwargs)
File "/home/alinefm/kimchi/src/kimchi/control/base.py", line 158, in index
'PUT': self.update}[method]()
File "/home/alinefm/kimchi/src/kimchi/control/base.py", line 135, in delete
fn(*self.model_args)
File "/home/alinefm/kimchi/src/kimchi/model/networks.py", line 327, in delete
self._remove_vlan_tagged_bridge(network)
File "/home/alinefm/kimchi/src/kimchi/model/networks.py", line 372, in
_remove_vlan_tagged_bridge
iface.destroy(0)
File "/home/alinefm/kimchi/src/kimchi/model/libvirtconnection.py", line 66, in
wrapper
ret = f(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/libvirt.py", line 2894, in destroy
if ret == -1: raise libvirtError ('virInterfaceDestroy() failed', net=self)
libvirtError: Requested operation is not valid: interface is not running
Signed-off-by: Aline Manera <alinefm(a)linux.vnet.ibm.com>
---
src/kimchi/model/networks.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/kimchi/model/networks.py b/src/kimchi/model/networks.py
index 7a52a19..6785e44 100644
--- a/src/kimchi/model/networks.py
+++ b/src/kimchi/model/networks.py
@@ -369,5 +369,5 @@ class NetworkModel(object):
if bridge.startswith(KIMCHI_BRIDGE_PREFIX):
conn = self.conn.get()
iface = conn.interfaceLookupByName(bridge)
- iface.destroy(0)
+ iface.isActive() and iface.destroy(0)
iface.undefine()
--
2.1.0