--- cdrom.image/sme7/product/installclasses/smeinstallclass.py 2009/06/08 14:43:06 1.3 +++ cdrom.image/sme7/product/installclasses/smeinstallclass.py 2009/06/10 14:22:18 1.4 @@ -143,17 +143,30 @@ class InstallClass(BaseInstallClass): self.cmdline = self.createCmdlineDict() diskset = partedUtils.DiskSet() - alldrives = diskset.driveList() + if self.cmdline.has_key("exclude"): + alldrives = filter(lambda x:not x in self.cmdline["exclude"].split(","), diskset.driveList()) + else: + alldrives = diskset.driveList() + if self.cmdline.has_key("drives"): - drives = filter(lambda x:self.mediaPresent(x) and - x in self.cmdline["drives"].split(","), alldrives) + if self.cmdline["drives"] == "all": + drives = filter(lambda x:self.mediaPresent(x), alldrives) + else: + drives = filter(lambda x:self.mediaPresent(x) and + x in self.cmdline["drives"].split(","), alldrives) else: drives = filter(lambda x:not isys.driveIsRemovable(x) and self.mediaPresent(x) and not isys.driveUsesModule(x, ["usb-storage", "ub", "sbp2"]), alldrives) if self.cmdline.has_key("spares"): - spares = max(0,min(int(self.cmdline["spares"]),len(drives)-2)) + if self.cmdline["spares"] == "none": + spares = 0 + else: + try: + spares = max(0,min(int(self.cmdline["spares"]),len(drives)-2)) + except: + spares = (len(drives)+4)/7 else: spares = (len(drives)+4)/7 @@ -182,7 +195,9 @@ class InstallClass(BaseInstallClass): level = 1 if len(drives) >= 1: + excluded = filter(lambda x:x not in drives, diskset.driveList()) log("Using the following drives: %s" % drives) + log("Excluding the following drives: %s" % excluded) if level >= 1: log("Installing using RAID%s" % level) log("Using %s spare drives" % spares)