[Kimchi-devel] [PATCH] [Kimchi] Bug fix 1119: Proper check NetworkManager is running when creating new network
Aline Manera
alinefm at linux.vnet.ibm.com
Mon Mar 27 17:05:45 UTC 2017
It was relying on Capabilities to verify NetworkManager was running or
not. But the Capabilities value is only updated on lookup() which was
leading on a wrong assumption.
To fix that, call FeatureTests function directly.
Signed-off-by: Aline Manera <alinefm at linux.vnet.ibm.com>
---
model/networks.py | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/model/networks.py b/model/networks.py
index eb1590e..b653b23 100644
--- a/model/networks.py
+++ b/model/networks.py
@@ -33,7 +33,7 @@ from wok.plugins.gingerbase.netinfo import get_vlan_device, is_bridge, is_vlan
from wok.plugins.gingerbase.netinfo import ports
from wok.plugins.kimchi import network as knetwork
from wok.plugins.kimchi.config import kimchiPaths
-from wok.plugins.kimchi.model.config import CapabilitiesModel
+from wok.plugins.kimchi.model.featuretests import FeatureTests
from wok.plugins.kimchi.osinfo import defaults as tmpl_defaults
from wok.plugins.kimchi.xmlutils.interface import get_iface_xml
from wok.plugins.kimchi.xmlutils.network import create_linux_bridge_xml
@@ -52,8 +52,6 @@ class NetworksModel(object):
if self.conn.isQemuURI():
self._check_default_networks()
- self.caps = CapabilitiesModel(**kargs)
-
def _check_default_networks(self):
networks = list(set(tmpl_defaults.get('networks', [])))
@@ -228,7 +226,7 @@ class NetworksModel(object):
# connection == macvtap and iface is not bridge
elif netinfo.is_bare_nic(iface) or netinfo.is_bonding(iface):
# libvirt bridge creation will fail with NetworkManager enabled
- if self.caps.nm_running:
+ if FeatureTests.is_nm_running():
raise InvalidParameter('KCHNET0027E')
if 'vlan_id' in params:
--
2.9.3
More information about the Kimchi-devel
mailing list