diff --git a/booty/bootloaderInfo.py b/booty/bootloaderInfo.py
index d9ab62e..8886df0 100644
--- a/booty/bootloaderInfo.py
+++ b/booty/bootloaderInfo.py
@@ -87,7 +87,7 @@ def rootIsDevice(dev):
class KernelArguments:
def getDracutStorageArgs(self, devices):
- args = []
+ args = set()
types = {}
for device in devices:
for d in self.id.storage.devices:
@@ -95,62 +95,55 @@ class KernelArguments:
continue
s = d.dracutSetupString()
- types[s.split("=")[0]] = True
- if s not in args:
- args.append(s)
+ for string in s:
+ types[string.split("=")[0]] = True
+ args.update(s)
import storage
if isinstance(d, storage.devices.NetworkStorageDevice):
s = self.id.network.dracutSetupString(d)
- if s not in args:
- args.append(s)
+ args.update(s)
for i in [ [ "rd_LUKS_UUID", "rd_NO_LUKS" ],
[ "rd_LVM_LV", "rd_NO_LVM" ],
[ "rd_MD_UUID", "rd_NO_MD" ],
[ "rd_DM_UUID", "rd_NO_DM" ] ]:
if not types.has_key(i[0]):
- args.append(i[1])
+ args.add(i[1])
for (key, val) in self.info.iteritems():
if val != None:
- args += " %s=%s" % (key, val)
+ args.add("%s=%s" % (key, val))
return args
diff --git a/network.py b/network.py
index eaf2f7b..fa726cc 100644
--- a/network.py
+++ b/network.py
@@ -730,7 +730,7 @@ class Network:
# get a kernel cmdline string for dracut needed for access to host host
def dracutSetupString(self, networkStorageDevice):
- netargs=""
+ netargs=set()
if networkStorageDevice.nic:
# Storage bound to a specific nic (ie FCoE)
@@ -748,7 +748,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
@@ -760,20 +760,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')
@@ -785,28 +785,23 @@ class Network:
if not netmask and prefix:
netmask = isys.prefix2netmask(int(prefix))
class LVMVolumeGroupDevice(DMDevice):
@@ -2556,7 +2556,7 @@ class LVMLogicalVolumeDevice(DMDevice):
def dracutSetupString(self):
# Note no mapName usage here, this is a lvm cmdline name, which
# is different (ofcourse)
- return "rd_LVM_LV=%s/%s" % (self.vg.name, self._name)
+ return set(["rd_LVM_LV=%s/%s" % (self.vg.name, self._name)])
def checkSize(self):
""" Check to make sure the size of the device is allowed by the
@@ -3111,7 +3111,7 @@ class MDRaidArrayDevice(StorageDevice):
return self.type == "mdbiosraidarray"
Does this mean you're leaving some dracutSetupString methods around?
If so, why not convert them as well. If not, is this just code you had
in for testing?
- Chris
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
06-22-2011, 02:30 PM
Chris Lumens
Keep dracut settings in sets instead of many long strings.
Does this mean you're leaving some dracutSetupString methods around?
If so, why not convert them as well. If not, is this just code you had
in for testing?
- Chris
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
06-23-2011, 02:20 PM
Chris Lumens
Keep dracut settings in sets instead of many long strings.
> Yes, one, the keyboard because I don't have control over it, it's in
> system-config-keybaord. What I was going to do is push this patch,
> open a bugzilla against sc-keyboard that the API has changed and
> once it is resolved I can remove the branching in bootloader.py.
> This way nothing ever gets broken.
Makes sense to me. Thanks for the clarification.
- Chris
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
06-23-2011, 02:20 PM
Chris Lumens
Keep dracut settings in sets instead of many long strings.
> Yes, one, the keyboard because I don't have control over it, it's in
> system-config-keybaord. What I was going to do is push this patch,
> open a bugzilla against sc-keyboard that the API has changed and
> once it is resolved I can remove the branching in bootloader.py.
> This way nothing ever gets broken.
Makes sense to me. Thanks for the clarification.
- Chris
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list