summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--iw/partition_dialog_gui.py2
-rw-r--r--storage/__init__.py9
-rw-r--r--storage/devicetree.py4
-rw-r--r--storage/partitioning.py7
-rw-r--r--yuminstall.py9
5 files changed, 13 insertions, 18 deletions
diff --git a/iw/partition_dialog_gui.py b/iw/partition_dialog_gui.py
index 8e0161e2b..d38aa4ec5 100644
--- a/iw/partition_dialog_gui.py
+++ b/iw/partition_dialog_gui.py
@@ -429,7 +429,7 @@ class PartitionEditor:
# aren't protected (we'd still like to be able to mount them, though)
self.fsoptionsDict = {}
if self.origrequest.exists and \
- not self.storage.isProtected(self.origrequest):
+ not self.origrequest.protected:
(row, self.fsoptionsDict) = createPreExistFSOptionSection(self.origrequest, maintable, row, self.mountCombo, self.storage, luksdev=luksdev)
# size options
diff --git a/storage/__init__.py b/storage/__init__.py
index 358b8088e..623eff11b 100644
--- a/storage/__init__.py
+++ b/storage/__init__.py
@@ -501,7 +501,7 @@ class Storage(object):
if not isinstance(device, Device):
raise ValueError("arg1 (%s) must be a Device instance" % device)
- if not ignoreProtected and device.name in self.protectedPartitions:
+ if not ignoreProtected and device.protected:
return _("This partition is holding the data for the hard "
"drive install.")
elif isinstance(device, PartitionDevice) and device.isProtected:
@@ -895,7 +895,7 @@ class Storage(object):
def isProtected(self, device):
""" Return True is the device is protected. """
- return device.name in self.protectedPartitions
+ return device.protected
def checkNoDisks(self):
"""Check that there are valid disk devices."""
@@ -1015,7 +1015,7 @@ def findExistingRootDevices(anaconda, upgradeany=False):
if not device.format.linuxNative or not device.format.mountable:
continue
- if device.name in anaconda.id.storage.protectedPartitions:
+ if device.protected:
# can't upgrade the part holding hd: media so why look at it?
continue
@@ -1057,8 +1057,7 @@ def mountExistingSystem(anaconda, rootEnt,
else:
readOnly = ""
- if rootDevice.name in anaconda.id.storage.protectedPartitions and \
- os.path.ismount("/mnt/isodir"):
+ if rootDevice.protected and os.path.ismount("/mnt/isodir"):
isys.mount("/mnt/isodir",
rootPath,
fstype=rootDevice.format.type,
diff --git a/storage/devicetree.py b/storage/devicetree.py
index 52dfd3606..9ffe726db 100644
--- a/storage/devicetree.py
+++ b/storage/devicetree.py
@@ -1610,8 +1610,8 @@ class DeviceTree(object):
device.format = None
return
- if shouldClear(device, self.clearPartType, self.clearPartDisks,
- self.protectedPartitions):
+ if shouldClear(device, self.clearPartType,
+ clearPartDisks=self.clearPartDisks):
# if this is a partition that will be cleared by clearpart,
# don't bother with format-specific processing
return
diff --git a/storage/partitioning.py b/storage/partitioning.py
index 5071ee0f0..7c6b1a7f0 100644
--- a/storage/partitioning.py
+++ b/storage/partitioning.py
@@ -258,7 +258,7 @@ def doAutoPartition(anaconda):
anaconda.id.storage.reset()
return DISPATCH_BACK
-def shouldClear(part, clearPartType, clearPartDisks=None, protectedPartitions=None):
+def shouldClear(part, clearPartType, clearPartDisks=None):
if not isinstance(part, PartitionDevice):
return False
@@ -277,7 +277,7 @@ def shouldClear(part, clearPartType, clearPartDisks=None, protectedPartitions=No
return False
# Don't clear partitions holding install media.
- if protectedPartitions and part.name in protectedPartitions:
+ if part.protected:
return False
# We don't want to fool with extended partitions, freespace, &c
@@ -321,8 +321,7 @@ def clearPartitions(storage):
clearparts = [] # list of partitions we'll remove
for part in partitions:
log.debug("clearpart: looking at %s" % part.name)
- if not shouldClear(part, storage.clearPartType, storage.clearPartDisks,
- storage.protectedPartitions):
+ if not shouldClear(part, storage.clearPartType, storage.clearPartDisks):
continue
log.debug("clearing %s" % part.name)
diff --git a/yuminstall.py b/yuminstall.py
index 70ed98ae9..fb89281e3 100644
--- a/yuminstall.py
+++ b/yuminstall.py
@@ -1434,12 +1434,9 @@ reposdir=/etc/anaconda.repos.d,/tmp/updates/anaconda.repos.d,/tmp/product/anacon
# If there are any protected partitions we want to mount, create their
# mount points now.
- protected = anaconda.id.storage.protectedPartitions
- if protected:
- for protectedDev in protected:
- request = anaconda.id.storage.devicetree.getDeviceByName(protectedDev)
- if request and request.format.mountpoint:
- dirList.append(request.format.mountpoint)
+ for protected in anaconda.id.storage.protectedDevices:
+ if getattr(protected.format, "mountpoint", None):
+ dirList.append(protected.format.mountpoint)
for i in dirList:
try: