143 |
self.cmdline = self.createCmdlineDict() |
self.cmdline = self.createCmdlineDict() |
144 |
diskset = partedUtils.DiskSet() |
diskset = partedUtils.DiskSet() |
145 |
|
|
146 |
alldrives = diskset.driveList() |
if self.cmdline.has_key("exclude"): |
147 |
|
alldrives = filter(lambda x:not x in self.cmdline["exclude"].split(","), diskset.driveList()) |
148 |
|
else: |
149 |
|
alldrives = diskset.driveList() |
150 |
|
|
151 |
if self.cmdline.has_key("drives"): |
if self.cmdline.has_key("drives"): |
152 |
drives = filter(lambda x:self.mediaPresent(x) and |
if self.cmdline["drives"] == "all": |
153 |
x in self.cmdline["drives"].split(","), alldrives) |
drives = filter(lambda x:self.mediaPresent(x), alldrives) |
154 |
|
else: |
155 |
|
drives = filter(lambda x:self.mediaPresent(x) and |
156 |
|
x in self.cmdline["drives"].split(","), alldrives) |
157 |
else: |
else: |
158 |
drives = filter(lambda x:not isys.driveIsRemovable(x) and |
drives = filter(lambda x:not isys.driveIsRemovable(x) and |
159 |
self.mediaPresent(x) and |
self.mediaPresent(x) and |
160 |
not isys.driveUsesModule(x, ["usb-storage", "ub", "sbp2"]), alldrives) |
not isys.driveUsesModule(x, ["usb-storage", "ub", "sbp2"]), alldrives) |
161 |
|
|
162 |
if self.cmdline.has_key("spares"): |
if self.cmdline.has_key("spares"): |
163 |
spares = max(0,min(int(self.cmdline["spares"]),len(drives)-2)) |
if self.cmdline["spares"] == "none": |
164 |
|
spares = 0 |
165 |
|
else: |
166 |
|
try: |
167 |
|
spares = max(0,min(int(self.cmdline["spares"]),len(drives)-2)) |
168 |
|
except: |
169 |
|
spares = (len(drives)+4)/7 |
170 |
else: |
else: |
171 |
spares = (len(drives)+4)/7 |
spares = (len(drives)+4)/7 |
172 |
|
|
195 |
level = 1 |
level = 1 |
196 |
|
|
197 |
if len(drives) >= 1: |
if len(drives) >= 1: |
198 |
|
excluded = filter(lambda x:x not in drives, diskset.driveList()) |
199 |
log("Using the following drives: %s" % drives) |
log("Using the following drives: %s" % drives) |
200 |
|
log("Excluding the following drives: %s" % excluded) |
201 |
if level >= 1: |
if level >= 1: |
202 |
log("Installing using RAID%s" % level) |
log("Installing using RAID%s" % level) |
203 |
log("Using %s spare drives" % spares) |
log("Using %s spare drives" % spares) |