[Kimchi-devel] [PATCH] [Kimchi] Bug fix 1119: Proper check NetworkManager is running when creating new network

Aline Manera posted 1 patch 7 years, 8 months ago
Failed in applying to current master (apply log)
model/networks.py | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
[Kimchi-devel] [PATCH] [Kimchi] Bug fix 1119: Proper check NetworkManager is running when creating new network
Posted by Aline Manera 7 years, 8 months ago
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@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

_______________________________________________
Kimchi-devel mailing list
Kimchi-devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/kimchi-devel
Re: [Kimchi-devel] [PATCH] [Kimchi] Bug fix 1119: Proper check NetworkManager is running when creating new network
Posted by Aline Manera 7 years, 8 months ago
Applied. Thanks.

Regards,

Aline Manera

_______________________________________________
Kimchi-devel mailing list
Kimchi-devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/kimchi-devel