summaryrefslogtreecommitdiffstats
path: root/network.py
diff options
context:
space:
mode:
authorDavid Cantrell <dcantrell@redhat.com>2009-05-28 11:08:51 -1000
committerDavid Cantrell <dcantrell@redhat.com>2009-06-02 10:11:20 -1000
commit6104124defc97a4f65d31c1cc5c09e0716f6f3c1 (patch)
tree37227291aad8b0c11e210e5ce2a3a4b6a2115aff /network.py
parent02edd45fa1fd9176c02d63100eef03d6ab91cd79 (diff)
downloadanaconda-6104124defc97a4f65d31c1cc5c09e0716f6f3c1.tar.gz
anaconda-6104124defc97a4f65d31c1cc5c09e0716f6f3c1.tar.xz
anaconda-6104124defc97a4f65d31c1cc5c09e0716f6f3c1.zip
Test NM_CONTROLLED setting correctly in network.py (#502466)
The only value we care about for NM_CONTROLLED is 'no', so change test to work that way. If performing a livecd install, make sure to carry over any NM_CONTROLLED settings in the ifcfg-* files on the live CD. Users with custom live images may have that set, so we should preserve it.
Diffstat (limited to 'network.py')
-rw-r--r--network.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/network.py b/network.py
index e3ce2c169..7cfb39966 100644
--- a/network.py
+++ b/network.py
@@ -248,7 +248,8 @@ class NetworkDevice(SimpleConfigFile):
keys.remove("KEY")
for key in keys:
- if key in ("NM_CONTROLLED", "NAME"):
+ if (key == 'NAME') or \
+ (key == 'NM_CONTROLLED' and not flags.livecdInstall):
continue
# make sure we include autoneg in the ethtool line
elif key == 'ETHTOOL_OPTS' and self.info[key].find("autoneg")== -1:
@@ -283,9 +284,9 @@ class Network:
# NetworkManager first, then fill in the gaps with the data
# from the ifcfg file
useNetworkManager = False
- if ifcfg_contents.has_key('NM_CONTROLLED'):
- if ifcfg_contents['NM_CONTROLLED'].lower() == 'yes' or ifcfg_contents['NM_CONTROLLED'] == '':
- useNetworkManager = True
+ if ifcfg_contents.has_key('NM_CONTROLLED') and \
+ not ifcfg_contents['NM_CONTROLLED'].lower() == 'no':
+ useNetworkManager = True
# this interface is managed by NetworkManager, so read from
# NetworkManager first