diff options
author | Mike Fulbright <msf@redhat.com> | 2003-07-10 23:14:36 +0000 |
---|---|---|
committer | Mike Fulbright <msf@redhat.com> | 2003-07-10 23:14:36 +0000 |
commit | c376c63465fb5d6e0d7e17aa86b6ae0c6437e092 (patch) | |
tree | cf3dbb75e6c97afabce89fb478c340040dad506a | |
parent | 1def62d877bd7f8efff3ef59109bbc7b70810a6f (diff) | |
download | anaconda-c376c63465fb5d6e0d7e17aa86b6ae0c6437e092.tar.gz anaconda-c376c63465fb5d6e0d7e17aa86b6ae0c6437e092.tar.xz anaconda-c376c63465fb5d6e0d7e17aa86b6ae0c6437e092.zip |
remove description when we write out config file
-rw-r--r-- | network.py | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/network.py b/network.py index a8da860bf..a03e2f134 100644 --- a/network.py +++ b/network.py @@ -6,7 +6,7 @@ # Mike Fulbright <msf@redhat.com> # Brent Fox <bfox@redhat.com> # -# Copyright 2001-2002 Red Hat, Inc. +# Copyright 2001-2003 Red Hat, Inc. # # This software may be freely redistributed under the terms of the GNU # library public license. @@ -21,6 +21,7 @@ import isys import socket import os import re +import kudzu from rhpl.log import log from rhpl.translate import _, N_ @@ -97,6 +98,8 @@ class NetworkDevice(SimpleConfigFile): keys = self.info.keys() keys.sort() keys.remove("DEVICE") + if "DESC" in keys: + keys.remove("DESC") # Don't let onboot be turned on unless we have config information # to go along with it @@ -197,8 +200,8 @@ class Network: # object member so we dont need to available_devices = self.available() - # set first device to start up onboot if len(available_devices) > 0: + # set first device to start up onboot oneactive = 0 for dev in available_devices.keys(): try: @@ -211,6 +214,19 @@ class Network: if not oneactive: self.netdevices[self.firstnetdevice].set(("onboot", "yes")) + # assign description to each device based on kudzu information + probedevs = kudzu.probe(kudzu.CLASS_NETWORK, kudzu.CLASS_UNSPEC, kudzu.PROBE_ALL) + for netdev in probedevs: + device = netdev.device + if device in self.netdevices.keys(): + desc = netdev.desc + if desc is not None and len(desc) > 0: + self.netdevices[device].set(("desc", desc)) + + # add hwaddr + self.netdevices[device].set(("hwaddr", isys.getMacAddress(device))) + + def getDevice(self, device): return self.netdevices[device] |