Skip to content

Commit

Permalink
Bug fix 1119: Proper check NetworkManager is running when creating ne…
Browse files Browse the repository at this point in the history
…w network

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 <[email protected]>
  • Loading branch information
alinefm committed Mar 29, 2017
1 parent a4a5472 commit 62cb580
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions model/networks.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
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
Expand All @@ -52,8 +52,6 @@ def __init__(self, **kargs):
if self.conn.isQemuURI():
self._check_default_networks()

self.caps = CapabilitiesModel(**kargs)

def _check_default_networks(self):
networks = list(set(tmpl_defaults.get('networks', [])))

Expand Down Expand Up @@ -228,7 +226,7 @@ def _set_network_bridge(self, params):
# 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:
Expand Down

0 comments on commit 62cb580

Please sign in to comment.