FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora Development

 
 
LinkBack Thread Tools
 
Old 11-30-2010, 07:09 PM
David Lehman
 
Default Move storage device scanning parameters into a separate class.

---
pyanaconda/iw/autopart_type.py | 36 ++++++------
pyanaconda/iw/cleardisks_gui.py | 10 ++--
pyanaconda/iw/examine_gui.py | 8 +-
pyanaconda/iw/partition_gui.py | 10 ++--
pyanaconda/kickstart.py | 16 +++---
pyanaconda/storage/__init__.py | 112 ++++++++++++++++++------------------
pyanaconda/storage/devicetree.py | 19 +++---
pyanaconda/storage/partitioning.py | 21 ++++---
pyanaconda/textw/partition_text.py | 10 ++--
9 files changed, 121 insertions(+), 121 deletions(-)

diff --git a/pyanaconda/iw/autopart_type.py b/pyanaconda/iw/autopart_type.py
index b0933d8..8d46d0a 100644
--- a/pyanaconda/iw/autopart_type.py
+++ b/pyanaconda/iw/autopart_type.py
@@ -148,12 +148,12 @@ class PartitionTypeWindow(InstallWindow):
raise gui.StayOnScreen

# reset storage, this is only done when moving forward, not back
- # temporarily unset storage.clearPartType so that all devices will be
- # found during storage reset
- clearPartType = self.anaconda.storage.clearPartType
- self.anaconda.storage.clearPartType = None
+ # temporarily unset storage.config.clearPartType so that all devices
+ # will be found during storage reset
+ clearPartType = self.anaconda.storage.config.clearPartType
+ self.anaconda.storage.config.clearPartType = None
self.anaconda.storage.reset()
- self.anaconda.storage.clearPartType = clearPartType
+ self.anaconda.storage.config.clearPartType = clearPartType

self.storage.clearPartChoice = self.buttonGroup.getCurrent()

@@ -163,7 +163,7 @@ class PartitionTypeWindow(InstallWindow):
self.dispatch.skipStep("partition", skip = 0)
self.dispatch.skipStep("bootloader", skip = 0)

- self.storage.clearPartType = CLEARPART_TYPE_NONE
+ self.storage.config.clearPartType = CLEARPART_TYPE_NONE
else:
if self.buttonGroup.getCurrent() == "shrink":
(rc, actions) = whichToShrink(self.storage, self.intf)
@@ -174,13 +174,13 @@ class PartitionTypeWindow(InstallWindow):
raise gui.StayOnScreen

# we're not going to delete any partitions in the resize case
- self.storage.clearPartType = CLEARPART_TYPE_NONE
+ self.storage.config.clearPartType = CLEARPART_TYPE_NONE
elif self.buttonGroup.getCurrent() == "all":
- self.storage.clearPartType = CLEARPART_TYPE_ALL
+ self.storage.config.clearPartType = CLEARPART_TYPE_ALL
elif self.buttonGroup.getCurrent() == "replace":
- self.storage.clearPartType = CLEARPART_TYPE_LINUX
+ self.storage.config.clearPartType = CLEARPART_TYPE_LINUX
elif self.buttonGroup.getCurrent() == "freespace":
- self.storage.clearPartType = CLEARPART_TYPE_NONE
+ self.storage.config.clearPartType = CLEARPART_TYPE_NONE

self.dispatch.skipStep("autopartitionexecute", skip = 0)
self.dispatch.skipStep("cleardiskssel", skip = 0)
@@ -205,9 +205,9 @@ class PartitionTypeWindow(InstallWindow):

def getPrev(self):
# Save the user's selection and restore system selection
- if self.storage.clearPartType is not None:
- self.anaconda.clearPartTypeSelection = self.storage.clearPartType
- self.storage.clearPartType = self.anaconda.clearPartTypeSystem
+ if self.storage.config.clearPartType is not None:
+ self.anaconda.clearPartTypeSelection = self.storage.config.clearPartType
+ self.storage.config.clearPartType = self.anaconda.clearPartTypeSystem

def typeChanged(self, *args):
if self.buttonGroup.getCurrent() == "custom":
@@ -233,9 +233,9 @@ class PartitionTypeWindow(InstallWindow):

if self.anaconda.dir == DISPATCH_FORWARD:
# Save system's partition type setting and restore user's
- self.anaconda.clearPartTypeSystem = self.storage.clearPartType
+ self.anaconda.clearPartTypeSystem = self.storage.config.clearPartType
if self.anaconda.clearPartTypeSelection is not None:
- self.storage.clearPartType = self.anaconda.clearPartTypeSelection
+ self.storage.config.clearPartType = self.anaconda.clearPartTypeSelection

(self.xml, vbox) = gui.getGladeWidget("autopart.glade", "parttypeTable")
self.encryptButton = self.xml.get_widget("encryptButton")
@@ -290,11 +290,11 @@ class PartitionTypeWindow(InstallWindow):
if self.storage.clearPartChoice:
self.buttonGroup.setCurrent(self.storage.clearPart Choice)
else:
- if self.storage.clearPartType is None or self.storage.clearPartType == CLEARPART_TYPE_LINUX:
+ if self.storage.config.clearPartType not in (None, CLEARPART_TYPE_LINUX):
self.buttonGroup.setCurrent("replace")
- elif self.storage.clearPartType == CLEARPART_TYPE_NONE:
+ elif self.storage.config.clearPartType == CLEARPART_TYPE_NONE:
self.buttonGroup.setCurrent("freespace")
- elif self.storage.clearPartType == CLEARPART_TYPE_ALL:
+ elif self.storage.config.clearPartType == CLEARPART_TYPE_ALL:
self.buttonGroup.setCurrent("all")

if self.buttonGroup.getCurrent() == "custom":
diff --git a/pyanaconda/iw/cleardisks_gui.py b/pyanaconda/iw/cleardisks_gui.py
index ca7196e..a9bdaf0 100644
--- a/pyanaconda/iw/cleardisks_gui.py
+++ b/pyanaconda/iw/cleardisks_gui.py
@@ -61,7 +61,7 @@ class ClearDisksWindow (InstallWindow):

cleardisks.sort(self.anaconda.storage.compareDisks )

- self.anaconda.storage.clearPartDisks = cleardisks
+ self.anaconda.storage.config.clearPartDisks = cleardisks
self.anaconda.bootloader.updateDriveList([bootDisk])

def getScreen (self, anaconda):
@@ -75,7 +75,7 @@ class ClearDisksWindow (InstallWindow):

# Skip this screen as well if there's only one disk to use.
if len(disks) == 1:
- anaconda.storage.clearPartDisks = [disks[0].name]
+ anaconda.storage.config.clearPartDisks = [disks[0].name]
anaconda.bootloader.drivelist = [disks[0].name]
return None

@@ -158,7 +158,7 @@ class ClearDisksWindow (InstallWindow):
# look up some more information in the devicetree, and set up the
# selector.
for d in disks:
- rightVisible = d.name in self.anaconda.storage.clearPartDisks
+ rightVisible = d.name in self.anaconda.storage.config.clearPartDisks
rightActive = rightVisible and
d.name in self.anaconda.bootloader.drivelist[:1]
leftVisible = not rightVisible
@@ -192,9 +192,9 @@ class ClearDisksWindow (InstallWindow):
self.leftTreeView.get_selection().set_mode(gtk.SEL ECTION_MULTIPLE)
self.rightTreeView.get_selection().set_mode(gtk.SE LECTION_MULTIPLE)

- if self.anaconda.storage.clearPartType == CLEARPART_TYPE_LINUX:
+ if self.anaconda.storage.config.clearPartType == CLEARPART_TYPE_LINUX:
self.installTargetTip.set_markup(_("<b>Tip:</b> All Linux filesystems on the install target devices will be reformatted and wiped of any data. Make sure you have backups."))
- elif self.anaconda.storage.clearPartType == CLEARPART_TYPE_ALL:
+ elif self.anaconda.storage.config.clearPartType == CLEARPART_TYPE_ALL:
self.installTargetTip.set_markup(_("<b>Tip:</b> The install target devices will be reformatted and wiped of any data. Make sure you have backups."))
else:
self.installTargetTip.set_markup(_("<b>Tip:</b> Your filesystems on the install target devices will not be reformatted unless you choose to do so during customization."))
diff --git a/pyanaconda/iw/examine_gui.py b/pyanaconda/iw/examine_gui.py
index baa42d4..99d3d18 100644
--- a/pyanaconda/iw/examine_gui.py
+++ b/pyanaconda/iw/examine_gui.py
@@ -88,12 +88,12 @@ class UpgradeExamineWindow (InstallWindow):
if anaconda.dir == DISPATCH_BACK:
# reset storage to catch any changes since we only reset when
# moving forward from autopart, not back.
- # temporarily unset storage.clearPartType so that all devices will be
+ # temporarily unset storage.config.clearPartType so that all devices will be
# found during storage reset
- clearPartType = self.anaconda.storage.clearPartType
- self.anaconda.storage.clearPartType = None
+ clearPartType = self.anaconda.storage.config.clearPartType
+ self.anaconda.storage.config.clearPartType = None
self.anaconda.storage.reset()
- self.anaconda.storage.clearPartType = clearPartType
+ self.anaconda.storage.config.clearPartType = clearPartType

# we might get here after storage reset that obsoleted
# root device objects we had found
diff --git a/pyanaconda/iw/partition_gui.py b/pyanaconda/iw/partition_gui.py
index de3b45c..95197bf 100644
--- a/pyanaconda/iw/partition_gui.py
+++ b/pyanaconda/iw/partition_gui.py
@@ -1564,12 +1564,12 @@ class PartitionWindow(InstallWindow):
return

self.stripeGraph.shutDown()
- # temporarily unset storage.clearPartType so that all devices will be
- # found during storage reset
- clearPartType = self.storage.clearPartType
- self.storage.clearPartType = None
+ # temporarily unset storage.config.clearPartType so that all devices
+ # will be found during storage reset
+ clearPartType = self.storage.config.clearPartType
+ self.storage.config.clearPartType = None
self.storage.reset()
- self.storage.clearPartType = clearPartType
+ self.storage.config.clearPartType = clearPartType
self.tree.clear()
self.populate()

diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py
index 482c3df..c508bf4 100644
--- a/pyanaconda/kickstart.py
+++ b/pyanaconda/kickstart.py
@@ -272,8 +272,8 @@ class Bootloader(commands.bootloader.F15_Bootloader):
disks = anaconda.storage.disks
partitioned = anaconda.storage.partitioned
for disk in [d for d in disks if not d.partitioned]:
- if shouldClear(disk, anaconda.storage.clearPartType,
- anaconda.storage.clearPartDisks):
+ if shouldClear(disk, anaconda.storage.config.clearPartType,
+ anaconda.storage.config.clearPartDisks):
# add newly partitioned disks to the drivelist
anaconda.bootloader.drivelist.append(disk.name)
elif disk.name in anaconda.bootloader.drivelist:
@@ -318,10 +318,10 @@ class ClearPart(commands.clearpart.FC3_ClearPart):
return retval

def execute(self, anaconda):
- anaconda.storage.clearPartType = self.type
- anaconda.storage.clearPartDisks = self.drives
+ anaconda.storage.config.clearPartType = self.type
+ anaconda.storage.config.clearPartDisks = self.drives
if self.initAll:
- anaconda.storage.reinitializeDisks = self.initAll
+ anaconda.storage.config.reinitializeDisks = self.initAll

clearPartitions(anaconda.storage)
anaconda.ksdata.skipSteps.append("cleardiskssel")
@@ -781,8 +781,8 @@ class PartitionData(commands.partition.F12_PartData):
raise KickstartValueError, formatErrorMsg(self.lineno, msg="Specified nonexistent disk %s in partition command" % n)

should_clear = shouldClear(disk,
- storage.clearPartType,
- storage.clearPartDisks)
+ storage.config.clearPartType,
+ storage.config.clearPartDisks)
if disk and (disk.partitioned or should_clear):
kwargs["disks"] = [disk]
break
@@ -1469,7 +1469,7 @@ def setSteps(anaconda):
# Storage is initialized for us right when kickstart processing starts.
dispatch.skipStep("storageinit")

- if not anaconda.storage.ignoreDiskInteractive:
+ if not anaconda.storage.config.ignoreDiskInteractive:
# Since ignoredisk is optional and not specifying it means you want to
# consider all possible disks, we should not stop on the filter steps
# unless we've been told to.
diff --git a/pyanaconda/storage/__init__.py b/pyanaconda/storage/__init__.py
index b8b1c90..29f6cc6 100644
--- a/pyanaconda/storage/__init__.py
+++ b/pyanaconda/storage/__init__.py
@@ -83,16 +83,16 @@ def storageInitialize(anaconda):
# Before we set up the storage system, we need to know which disks to
# ignore, etc. Luckily that's all in the kickstart data.
if anaconda.ksdata:
- anaconda.storage.zeroMbr = anaconda.ksdata.zerombr.zerombr
- anaconda.storage.ignoreDiskInteractive = anaconda.ksdata.ignoredisk.interactive
- anaconda.storage.ignoredDisks = anaconda.ksdata.ignoredisk.ignoredisk
- anaconda.storage.exclusiveDisks = anaconda.ksdata.ignoredisk.onlyuse
+ anaconda.storage.config.zeroMbr = anaconda.ksdata.zerombr.zerombr
+ anaconda.storage.config.ignoreDiskInteractive = anaconda.ksdata.ignoredisk.interactive
+ anaconda.storage.config.ignoredDisks = anaconda.ksdata.ignoredisk.ignoredisk
+ anaconda.storage.config.exclusiveDisks = anaconda.ksdata.ignoredisk.onlyuse

if anaconda.ksdata.clearpart.type is not None:
- anaconda.storage.clearPartType = anaconda.ksdata.clearpart.type
- anaconda.storage.clearPartDisks = anaconda.ksdata.clearpart.drives
+ anaconda.storage.config.clearPartType = anaconda.ksdata.clearpart.type
+ anaconda.storage.config.clearPartDisks = anaconda.ksdata.clearpart.drives
if anaconda.ksdata.clearpart.initAll:
- anaconda.storage.reinitializeDisks = anaconda.ksdata.clearpart.initAll
+ anaconda.storage.config.reinitializeDisks = anaconda.ksdata.clearpart.initAll

anaconda.intf.resetInitializeDiskQuestion()
anaconda.intf.resetReinitInconsistentLVMQuestion()
@@ -100,7 +100,7 @@ def storageInitialize(anaconda):

# Set up the protected partitions list now.
if anaconda.protected:
- storage.protectedDevSpecs.extend(anaconda.protecte d)
+ storage.config.protectedDevSpecs.extend(anaconda.p rotected)
storage.reset()

if not flags.livecdInstall and not storage.protectedDevices:
@@ -257,17 +257,51 @@ def undoEncryption(storage):
storage.devicetree.registerAction(ActionDestroyFor mat(slave))
storage.devicetree.registerAction(ActionCreateForm at(slave, format))

-class Storage(object):
- def __init__(self, anaconda):
- self.anaconda = anaconda
-
+class StorageDiscoveryConfig(object):
+ def __init__(self):
# storage configuration variables
self.ignoreDiskInteractive = False
self.ignoredDisks = []
self.exclusiveDisks = []
- self.doAutoPart = False
self.clearPartType = None
self.clearPartDisks = []
+ self.reinitializeDisks = False
+ self.zeroMbr = None
+ self.protectedDevSpecs = []
+
+ def writeKS(self, f):
+ # clearpart
+ if self.clearPartType is None or self.clearPartType == CLEARPART_TYPE_NONE:
+ args = ["--none"]
+ elif self.clearPartType == CLEARPART_TYPE_LINUX:
+ args = ["--linux"]
+ else:
+ args = ["--all"]
+
+ if self.clearPartDisks:
+ args += ["--drives=%s" % ",".join(self.clearPartDisks)]
+ if self.reinitializeDisks:
+ args += ["--initlabel"]
+
+ f.write("#clearpart %s
" % " ".join(args))
+
+ # ignoredisks
+ if self.ignoreDiskInteractive:
+ f.write("#ignoredisk --interactive
")
+ elif self.ignoredDisks:
+ f.write("#ignoredisk --drives=%s
" % ",".join(self.ignoredDisks))
+ elif self.exclusiveDisks:
+ f.write("#ignoredisk --only-use=%s
" % ",".join(self.exclusiveDisks))
+
+
+class Storage(object):
+ def __init__(self, anaconda):
+ self.anaconda = anaconda
+
+ self.config = StorageDiscoveryConfig()
+
+ # storage configuration variables
+ self.doAutoPart = False
self.clearPartChoice = None
self.encryptedAutoPart = False
self.encryptionPassphrase = None
@@ -275,9 +309,6 @@ class Storage(object):
self.autoPartEscrowCert = None
self.autoPartAddBackupPassphrase = False
self.encryptionRetrofit = False
- self.reinitializeDisks = False
- self.zeroMbr = None
- self.protectedDevSpecs = []
self.autoPartitionRequests = []
self.eddDict = {}

@@ -295,13 +326,7 @@ class Storage(object):

# these will both be empty until our reset method gets called
self.devicetree = DeviceTree(intf=self.anaconda.intf,
- ignored=self.ignoredDisks,
- exclusive=self.exclusiveDisks,
- type=self.clearPartType,
- clear=self.clearPartDisks,
- reinitializeDisks=self.reinitializeDisks,
- protected=self.protectedDevSpecs,
- zeroMbr=self.zeroMbr,
+ conf=self.config,
passphrase=self.encryptionPassphrase,
luksDict=self.__luksDevs,
iscsi=self.iscsi,
@@ -379,25 +404,21 @@ class Storage(object):
self.iscsi.startup(self.anaconda.intf)
self.fcoe.startup(self.anaconda.intf)
self.zfcp.startup(self.anaconda.intf)
- self.dasd.startup(self.anaconda.intf, self.exclusiveDisks, self.zeroMbr)
+ self.dasd.startup(self.anaconda.intf,
+ self.config.exclusiveDisks,
+ self.config.zeroMbr)
+ clearPartType = self.config.clearPartType # save this before overriding it
if self.anaconda.upgrade:
- clearPartType = CLEARPART_TYPE_NONE
- else:
- clearPartType = self.clearPartType
+ self.config.clearPartType = CLEARPART_TYPE_NONE

self.devicetree = DeviceTree(intf=self.anaconda.intf,
- ignored=self.ignoredDisks,
- exclusive=self.exclusiveDisks,
- type=clearPartType,
- clear=self.clearPartDisks,
- reinitializeDisks=self.reinitializeDisks,
- protected=self.protectedDevSpecs,
- zeroMbr=self.zeroMbr,
+ conf=self.config,
passphrase=self.encryptionPassphrase,
luksDict=self.__luksDevs,
iscsi=self.iscsi,
dasd=self.dasd)
self.devicetree.populate()
+ self.config.clearPartType = clearPartType # set it back
self.fsset = FSSet(self.devicetree, self.anaconda.rootPath)
self.eddDict = get_edd_dict(self.partitioned)
self.anaconda.rootParts = None
@@ -1106,28 +1127,7 @@ class Storage(object):
f.write("# here so unless you clear all partitions first, this is
")
f.write("# not guaranteed to work
")

- # clearpart
- if self.clearPartType is None or self.clearPartType == CLEARPART_TYPE_NONE:
- args = ["--none"]
- elif self.clearPartType == CLEARPART_TYPE_LINUX:
- args = ["--linux"]
- else:
- args = ["--all"]
-
- if self.clearPartDisks:
- args += ["--drives=%s" % ",".join(self.clearPartDisks)]
- if self.reinitializeDisks:
- args += ["--initlabel"]
-
- f.write("#clearpart %s
" % " ".join(args))
-
- # ignoredisks
- if self.ignoreDiskInteractive:
- f.write("#ignoredisk --interactive
")
- elif self.ignoredDisks:
- f.write("#ignoredisk --drives=%s
" % ",".join(self.ignoredDisks))
- elif self.exclusiveDisks:
- f.write("#ignoredisk --only-use=%s
" % ",".join(self.exclusiveDisks))
+ self.config.writeKS(f)

# the various partitioning commands
dict = {}
diff --git a/pyanaconda/storage/devicetree.py b/pyanaconda/storage/devicetree.py
index f7573f8..d129050 100644
--- a/pyanaconda/storage/devicetree.py
+++ b/pyanaconda/storage/devicetree.py
@@ -152,9 +152,8 @@ class DeviceTree(object):
except for resize actions.
"""

- def __init__(self, intf=None, ignored=[], exclusive=[], type=CLEARPART_TYPE_NONE,
- clear=[], zeroMbr=None, reinitializeDisks=None, protected=[],
- passphrase=None, luksDict=None, iscsi=None, dasd=None):
+ def __init__(self, intf=None, conf=None, passphrase=None, luksDict=None,
+ iscsi=None, dasd=None):
# internal data members
self._devices = []
self._actions = []
@@ -163,16 +162,16 @@ class DeviceTree(object):
self.populated = False

self.intf = intf
- self.exclusiveDisks = exclusive
- self.clearPartType = type
- self.clearPartDisks = clear
- self.zeroMbr = zeroMbr
- self.reinitializeDisks = reinitializeDisks
+ self.exclusiveDisks = getattr(conf, "exclusiveDisks", [])
+ self.clearPartType = getattr(conf, "clearPartType", CLEARPART_TYPE_NONE)
+ self.clearPartDisks = getattr(conf, "clearPartDisks", [])
+ self.zeroMbr = getattr(conf, "zeroMbr", False)
+ self.reinitializeDisks = getattr(conf, "reinitializeDisks", False)
self.iscsi = iscsi
self.dasd = dasd

# protected device specs as provided by the user
- self.protectedDevSpecs = protected
+ self.protectedDevSpecs = getattr(conf, "protectedDevSpecs", [])

# names of protected devices at the time of tree population
self.protectedDevNames = []
@@ -187,7 +186,7 @@ class DeviceTree(object):
if luksDict and isinstance(luksDict, dict):
self.__luksDevs = luksDict
self._ignoredDisks = []
- for disk in ignored:
+ for disk in getattr(conf, "ignoredDisks", []):
self.addIgnoredDisk(disk)
devicelibs.lvm.lvm_cc_resetFilter()

diff --git a/pyanaconda/storage/partitioning.py b/pyanaconda/storage/partitioning.py
index e1d4eae..c0bfd82 100644
--- a/pyanaconda/storage/partitioning.py
+++ b/pyanaconda/storage/partitioning.py
@@ -45,8 +45,8 @@ def _createFreeSpacePartitions(anaconda):
# least the default size for new partitions
disks = []
for disk in anaconda.storage.partitioned:
- if anaconda.storage.clearPartDisks and
- (disk.name not in anaconda.storage.clearPartDisks):
+ if anaconda.storage.config.clearPartDisks and
+ (disk.name not in anaconda.storage.config.clearPartDisks):
continue

part = disk.format.firstPartition
@@ -170,8 +170,8 @@ def _scheduleLVs(anaconda, devs):
def doAutoPartition(anaconda):
log.debug("doAutoPartition(%s)" % anaconda)
log.debug("doAutoPart: %s" % anaconda.storage.doAutoPart)
- log.debug("clearPartType: %s" % anaconda.storage.clearPartType)
- log.debug("clearPartDisks: %s" % anaconda.storage.clearPartDisks)
+ log.debug("clearPartType: %s" % anaconda.storage.config.clearPartType)
+ log.debug("clearPartDisks: %s" % anaconda.storage.config.clearPartDisks)
log.debug("autoPartitionRequests: %s" % anaconda.storage.autoPartitionRequests)
log.debug("storage.disks: %s" % [d.name for d in anaconda.storage.disks])
log.debug("storage.partitioned: %s" % [d.name for d in anaconda.storage.partitioned])
@@ -217,7 +217,7 @@ def doAutoPartition(anaconda):
# run the autopart function to allocate and grow partitions
try:
doPartitioning(anaconda.storage,
- exclusiveDisks=anaconda.storage.clearPartDisks)
+ exclusiveDisks=anaconda.storage.config.exclusiveDi sks)

if anaconda.storage.doAutoPart:
_scheduleLVs(anaconda, devs)
@@ -351,7 +351,7 @@ def clearPartitions(storage):
- Needs some error handling, especially for the parted bits.

"""
- if storage.clearPartType is None or storage.clearPartType == CLEARPART_TYPE_NONE:
+ if storage.config.clearPartType is None or storage.config.clearPartType == CLEARPART_TYPE_NONE:
# not much to do
return

@@ -364,7 +364,7 @@ def clearPartitions(storage):
partitions.sort(key=lambda p: p.partedPartition.number, reverse=True)
for part in partitions:
log.debug("clearpart: looking at %s" % part.name)
- if not shouldClear(part, storage.clearPartType, storage.clearPartDisks):
+ if not shouldClear(part, storage.config.clearPartType, storage.config.clearPartDisks):
continue

log.debug("clearing %s" % part.name)
@@ -385,7 +385,7 @@ def clearPartitions(storage):

for disk in [d for d in storage.disks if d not in storage.partitioned]:
# clear any whole-disk formats that need clearing
- if shouldClear(disk, storage.clearPartType, storage.clearPartDisks):
+ if shouldClear(disk, storage.config.clearPartType, storage.config.clearPartDisks):
log.debug("clearing %s" % disk.name)
devices = storage.deviceDeps(disk)
while devices:
@@ -416,8 +416,9 @@ def clearPartitions(storage):
if disk.name != storage.anaconda.bootloader.drivelist[0]:
continue

- if storage.clearPartType != CLEARPART_TYPE_ALL or
- (storage.clearPartDisks and disk.name not in storage.clearPartDisks):
+ if storage.config.clearPartType != CLEARPART_TYPE_ALL or
+ (storage.config.clearPartDisks and
+ disk.name not in storage.config.clearPartDisks):
continue

# Don't touch immutable disks
diff --git a/pyanaconda/textw/partition_text.py b/pyanaconda/textw/partition_text.py
index c65788c..603592f 100644
--- a/pyanaconda/textw/partition_text.py
+++ b/pyanaconda/textw/partition_text.py
@@ -68,10 +68,10 @@ class PartitionTypeWindow:
for (txt, val) in opts:
typebox.append(txt, val)

- if anaconda.storage.clearPartType is None:
+ if anaconda.storage.config.clearPartType is None:
preselection = CLEARPART_TYPE_LINUX
else:
- preselection = anaconda.storage.clearPartType
+ preselection = anaconda.storage.config.clearPartType
typebox.setCurrent(preselection)

g.add(typebox, 0, 1, (0, 1, 0, 0))
@@ -97,7 +97,7 @@ class PartitionTypeWindow:

# restore the drive list each time
disks = anaconda.storage.partitioned
- cleardrives = anaconda.storage.clearPartDisks
+ cleardrives = anaconda.storage.config.clearPartDisks

for disk in disks:
model = disk.model
@@ -147,8 +147,8 @@ class PartitionTypeWindow:

anaconda.dispatch.skipStep("autopartitionexecute", skip = 0)
anaconda.storage.doAutoPart = True
- anaconda.storage.clearPartType = partmethod_ans
- anaconda.storage.clearPartDisks = sel
+ anaconda.storage.config.clearPartType = partmethod_ans
+ anaconda.storage.config.clearPartDisks = sel
break

# ask to review autopartition layout - but only if it's not custom partitioning
--
1.7.3.2

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 01:01 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org