summaryrefslogtreecommitdiffstats
path: root/network.py
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2009-03-17 19:06:57 +0100
committerHans de Goede <hdegoede@redhat.com>2009-03-17 19:08:38 +0100
commit164e80fd66563a410579df3d1a521e7557621a71 (patch)
tree949b0944b2c99b5294fadc6000c627c902a043ff /network.py
parent2a6e841778c7b75fa09e8396d0ad9777b0a6c0e0 (diff)
downloadanaconda-164e80fd66563a410579df3d1a521e7557621a71.tar.gz
anaconda-164e80fd66563a410579df3d1a521e7557621a71.tar.xz
anaconda-164e80fd66563a410579df3d1a521e7557621a71.zip
Tell NM not to touch interfaces when / is on a network disk
This patch renames storage.NetworkDevice to storage.NetworkStorageDevice, as NetworkDevice as classname also is used in network.py . It also changes NetworkStorageDevice so that it does not inherit from Device, as it is now intended for use in multiple inheritance together with StorageDevice (or a derived class) as explained further in the comments in the code. Then this patch changes iScsiDiskDevice and NFSDevice to additional inherit from NetworkStorageDevice (next to what they were already inheriting from. And last if fixes the code in network.py to properly write NM_CONTROLLED=NO when / uses a network backed device.
Diffstat (limited to 'network.py')
-rw-r--r--network.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/network.py b/network.py
index 4a2eca9d5..5dc9060f0 100644
--- a/network.py
+++ b/network.py
@@ -581,14 +581,17 @@ class Network:
f.write("MTU=%s\n" % dev.get('MTU'))
# tell NetworkManager not to touch any interfaces used during
- # installation when / is on a network device. Ideally we would only
- # tell NM not to touch the interface(s) actually used for /, but we
- # have no logic to determine that
+ # installation when / is on a network backed device.
if anaconda is not None:
import storage
rootdev = anaconda.id.storage.fsset.rootDevice
- if isinstance(rootdev, storage.devices.NetworkDevice):
- f.write("NM_CONTROLLED=no\n")
+ # FIXME: use device.host_address to only add "NM_CONTROLLED=no"
+ # for interfaces actually used enroute to the device
+ for d in anaconda.id.storage.devices:
+ if rootdev.dependsOn(d) and isinstance(d,
+ storage.devices.NetworkStorageDevice):
+ f.write("NM_CONTROLLED=no\n")
+ break
f.close()
os.chmod(newifcfg, 0644)