summaryrefslogtreecommitdiffstats
path: root/partedUtils.py
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2002-08-02 07:41:47 +0000
committerJeremy Katz <katzj@redhat.com>2002-08-02 07:41:47 +0000
commit5db25af03323724b0fdf88de2ca88a6845836819 (patch)
tree24e221bbd77b8af8890b93ccd7c84de3ee351606 /partedUtils.py
parent2d4676c0a51cbf710a125825f91d12f96ed111c6 (diff)
downloadanaconda-5db25af03323724b0fdf88de2ca88a6845836819.tar.gz
anaconda-5db25af03323724b0fdf88de2ca88a6845836819.tar.xz
anaconda-5db25af03323724b0fdf88de2ca88a6845836819.zip
pass down drives from clearpart so that we only init the drives you list for doing a clearpart on (#64160)
Diffstat (limited to 'partedUtils.py')
-rw-r--r--partedUtils.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/partedUtils.py b/partedUtils.py
index 2a140084e..2938a1386 100644
--- a/partedUtils.py
+++ b/partedUtils.py
@@ -533,11 +533,12 @@ class DiskSet:
del disk
self.refreshDevices()
- def refreshDevices (self, intf = None, initAll = 0, zeroMbr = 0):
+ def refreshDevices (self, intf = None, initAll = 0,
+ zeroMbr = 0, clearDevs = []):
"""Reread the state of the disks as they are on disk."""
self.closeDevices()
self.disks = {}
- self.openDevices(intf, initAll, zeroMbr)
+ self.openDevices(intf, initAll, zeroMbr, clearDevs)
def closeDevices (self):
"""Close all of the disks which are open."""
@@ -624,7 +625,8 @@ class DiskSet:
return 1
- def openDevices (self, intf = None, initAll = 0, zeroMbr = 0):
+ def openDevices (self, intf = None, initAll = 0,
+ zeroMbr = 0, clearDevs = []):
"""Open the disks on the system and skip unopenable devices."""
if self.disks:
return
@@ -640,7 +642,8 @@ class DiskSet:
except parted.error, msg:
DiskSet.skippedDisks.append(drive)
continue
- if initAll and not flags.test:
+ if (initAll and ((clearDevs is None) or (len(clearDevs) == 0)
+ or drive in clearDevs) and not flags.test):
try:
dev.disk_create(getDefaultDiskType())
disk = parted.PedDisk.open(dev)