[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [PATCH 3/3] Carry rdloaddriver= parameters through to the boot loader config.

On 08/10/2011 08:16 PM, David Cantrell wrote:
-            cmdlineDict[key] = val
+            if key.lower() == "rdloaddriver":
+                key = key.lower()
+            if cmdlineDict.has_key(key):
+                if type(cmdlineDict[key]) == type(set()):
+                    cmdlineDict[key].add(val)
+                else:
+                    tmpset = set()
+                    tmpset.add(cmdlineDict[key])
+                    tmpset.add(val)
+                    cmdlineDict[key] = tmpset
+            else:
+                cmdlineDict[key] = val


I think at this point when we clearly need to hold certain key's values as sets it would be better if we changed the cmdlineDict's values to be always a set, so the client code knows what to expect. For instance in network.py, there is:

bootif_mac = flags.cmdline.get("BOOTIF")[3:].replace("-", ":").upper()

But if two BOOTIFs were entered as the boot arguments, cmdlineDict["BOOTIF"] is a set and the [3:] will traceback.

Alternatively, we can define some keys to always have set values and the remaining keys to always have string values.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]