summaryrefslogtreecommitdiffstats
path: root/pyanaconda/network.py
diff options
context:
space:
mode:
authorAles Kozumplik <akozumpl@redhat.com>2011-06-20 14:10:04 +0200
committerAles Kozumplik <akozumpl@redhat.com>2011-06-24 08:37:52 +0200
commit97941fb18bae8252f24f7d53280d3a23e5d4e243 (patch)
tree63bb4de314e3bb0d8d38aa2ad1a026a0897f935d /pyanaconda/network.py
parent9e7d298e6bb6515d88430e5a259ad9d71aaa18f5 (diff)
downloadanaconda-97941fb18bae8252f24f7d53280d3a23e5d4e243.tar.gz
anaconda-97941fb18bae8252f24f7d53280d3a23e5d4e243.tar.xz
anaconda-97941fb18bae8252f24f7d53280d3a23e5d4e243.zip
Keep dracut settings in sets instead of many long strings.
This will avoid duplicities in the resulting kernel boot argument line. The patch is merged from the rhel6-branch and since bootloader.py has been overhauled the changes there are different.
Diffstat (limited to 'pyanaconda/network.py')
-rw-r--r--pyanaconda/network.py34
1 files changed, 14 insertions, 20 deletions
diff --git a/pyanaconda/network.py b/pyanaconda/network.py
index 0d10d8275..4f9ab0f33 100644
--- a/pyanaconda/network.py
+++ b/pyanaconda/network.py
@@ -815,8 +815,8 @@ class Network:
return False
# get a kernel cmdline string for dracut needed for access to host host
- def dracutSetupString(self, networkStorageDevice):
- netargs=""
+ def dracutSetupArgs(self, networkStorageDevice):
+ netargs=set()
if networkStorageDevice.nic:
# Storage bound to a specific nic (ie FCoE)
@@ -834,7 +834,7 @@ class Network:
dev = self.netdevices[nic]
if dev.get('BOOTPROTO') == 'ibft':
- netargs += "ip=ibft"
+ netargs.add("ip=ibft")
elif networkStorageDevice.host_address:
if self.hostname:
hostname = self.hostname
@@ -846,20 +846,20 @@ class Network:
if dev.get('DHCPV6C') == "yes":
# XXX combination with autoconf not yet clear,
# support for dhcpv6 is not yet implemented in NM/ifcfg-rh
- netargs += "ip=%s:dhcp6" % nic
+ netargs.add("ip=%s:dhcp6" % nic)
elif dev.get('IPV6_AUTOCONF') == "yes":
- netargs += "ip=%s:auto6" % nic
+ netargs.add("ip=%s:auto6" % nic)
elif dev.get('IPV6ADDR'):
ipaddr = "[%s]" % dev.get('IPV6ADDR')
if dev.get('IPV6_DEFAULTGW'):
gateway = "[%s]" % dev.get('IPV6_DEFAULTGW')
else:
gateway = ""
- netargs += "ip=%s::%s:%s:%s:%s:none" % (ipaddr, gateway,
- dev.get('PREFIX'), hostname, nic)
+ netargs.add("ip=%s::%s:%s:%s:%s:none" % (ipaddr, gateway,
+ dev.get('PREFIX'), hostname, nic))
else:
if dev.get('bootproto').lower() == 'dhcp':
- netargs += "ip=%s:dhcp" % nic
+ netargs.add("ip=%s:dhcp" % nic)
else:
if dev.get('GATEWAY'):
gateway = dev.get('GATEWAY')
@@ -871,28 +871,22 @@ class Network:
if not netmask and prefix:
netmask = isys.prefix2netmask(int(prefix))
- netargs += "ip=%s::%s:%s:%s:%s:none" % (dev.get('ipaddr'),
- gateway, netmask, hostname, nic)
+ netargs.add("ip=%s::%s:%s:%s:%s:none" % (dev.get('ipaddr'),
+ gateway, netmask, hostname, nic))
hwaddr = dev.get("HWADDR")
if hwaddr:
- if netargs != "":
- netargs += " "
-
- netargs += "ifname=%s:%s" % (nic, hwaddr.lower())
+ netargs.add("ifname=%s:%s" % (nic, hwaddr.lower()))
nettype = dev.get("NETTYPE")
subchannels = dev.get("SUBCHANNELS")
if iutil.isS390() and nettype and subchannels:
- if netargs != "":
- netargs += " "
-
- netargs += "rd.znet=%s,%s" % (nettype, subchannels)
-
+ znet = "rd.znet=%s,%s" % (nettype, subchannels)
options = dev.get("OPTIONS").strip("'\"")
if options:
options = filter(lambda x: x != '', options.split(' '))
- netargs += ",%s" % (','.join(options))
+ znet += ",%s" % (','.join(options))
+ netargs.add(znet)
return netargs