summaryrefslogtreecommitdiffstats
path: root/pyanaconda/ui/gui/spokes/custom.py
diff options
context:
space:
mode:
authorDavid Lehman <dlehman@redhat.com>2012-10-10 12:29:20 -0500
committerDavid Lehman <dlehman@redhat.com>2012-10-12 09:24:55 -0500
commit0f898de717c856338aae173bd9a45edc32a7e7b8 (patch)
tree0dc24f9272778ebb2162d3975e842d4bebd5685f /pyanaconda/ui/gui/spokes/custom.py
parentc6f82dde8eccc3eba757a0331ccce2b89f006e18 (diff)
downloadanaconda-0f898de717c856338aae173bd9a45edc32a7e7b8.tar.gz
anaconda-0f898de717c856338aae173bd9a45edc32a7e7b8.tar.xz
anaconda-0f898de717c856338aae173bd9a45edc32a7e7b8.zip
Support change of raid level in custom spoke.
Diffstat (limited to 'pyanaconda/ui/gui/spokes/custom.py')
-rw-r--r--pyanaconda/ui/gui/spokes/custom.py32
1 files changed, 26 insertions, 6 deletions
diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
index 054124cd8..edc2cd00f 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -939,9 +939,6 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
encrypted=encrypted,
raid_level=raid_level)
- # for raid settings, we'll need to adjust the member set and container,
- # and possibly also its devices
-
# for member type, we'll have to adjust the member set.
# XXX not going to worry about this for now
@@ -951,14 +948,37 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
device_types = {"partition": AUTOPART_TYPE_PLAIN,
"lvmlv": AUTOPART_TYPE_LVM,
"btrfs subvolume": AUTOPART_TYPE_BTRFS,
+ "btrfs volume": AUTOPART_TYPE_BTRFS,
"mdarray": None}
current_device_type = device.type
+ use_dev = device
if current_device_type == "luks/dm-crypt":
current_device_type = device.slave.type
+ use_dev = device.slave
current_device_type = device_types.get(current_device_type)
- if current_device_type != device_type:
- log.info("changing device type from %s to %s" % (current_device_type,
- device_type))
+
+ old_raid_level = None
+ if current_device_type is None:
+ old_raid_level = mdraid.raidLevelString(use_dev.level)
+ elif current_device_type == AUTOPART_TYPE_BTRFS:
+ if hasattr(use_dev, "dataLevel"):
+ old_raid_level = use_dev.dataLevel or "single"
+ else:
+ old_raid_level = use_dev.volume.dataLevel or "single"
+
+ changed_device_type = (current_device_type != device_type)
+ changed_raid_level = (current_device_type == device_type and
+ device_type in (None, AUTOPART_TYPE_BTRFS) and
+ old_raid_level != raid_level)
+
+ if changed_device_type or changed_raid_level:
+ if changed_device_type:
+ log.info("changing device type from %s to %s"
+ % (current_device_type, device_type))
+ else:
+ log.info("changing raid level from %s to %s"
+ % (old_raid_level, raid_level))
+
# remove the current device
self.clear_errors()
root = self._current_selector._root