[blivet:master/rhel7 4/9] Change allow_degraded_mdraid flag to allow_imperfect_devices (#1090009)

mulhern amulhern at redhat.com
Thu Dec 11 22:29:24 UTC 2014


Related: rhbz#1090009

The only change is a name change. The plan is to use this flag for situations
where it is better to use the imperfect device then to deactivate or remove it
or otherwise get it out of sight.

Generally, when installing, imperfect devices are best avoided, because
you don't really want to install onto them. But when in installer rescue
mode and many other situations, it is better to expose an imperfect but
still usable device.

Signed-off-by: mulhern <amulhern at redhat.com>
---
 blivet/devicetree.py | 6 +++---
 blivet/flags.py      | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/blivet/devicetree.py b/blivet/devicetree.py
index 3f3fca2..f2032de 100644
--- a/blivet/devicetree.py
+++ b/blivet/devicetree.py
@@ -863,7 +863,7 @@ class DeviceTree(object):
                         return
 
         # try to get the device again now that we've got all the slaves
-        device = self.getDeviceByName(name, incomplete=flags.allow_degraded_mdraid)
+        device = self.getDeviceByName(name, incomplete=flags.allow_imperfect_devices)
 
         if device is None:
             try:
@@ -871,7 +871,7 @@ class DeviceTree(object):
             except KeyError:
                 log.warning("failed to obtain uuid for mdraid device")
             else:
-                device = self.getDeviceByUuid(uuid, incomplete=flags.allow_degraded_mdraid)
+                device = self.getDeviceByUuid(uuid, incomplete=flags.allow_imperfect_devices)
 
         if device:
             # update the device instance with the real name in case we had to
@@ -1139,7 +1139,7 @@ class DeviceTree(object):
         if device is None and udev.device_is_md(info):
             device = self.getDeviceByName(
                udev.device_get_md_name(info),
-               incomplete=flags.allow_degraded_mdraid)
+               incomplete=flags.allow_imperfect_devices)
             if device and not isinstance(device, MDRaidArrayDevice):
                 # make sure any device we found is an md device
                 device = None
diff --git a/blivet/flags.py b/blivet/flags.py
index 4c3c86c..0ff1c96 100644
--- a/blivet/flags.py
+++ b/blivet/flags.py
@@ -67,7 +67,7 @@ class Flags(object):
         self.boot_cmdline = {}
 
         self.update_from_boot_cmdline()
-        self.allow_degraded_mdraid = True
+        self.allow_imperfect_devices = True
 
     def get_boot_cmdline(self):
         buf = open("/proc/cmdline").read().strip()
@@ -105,7 +105,7 @@ class Flags(object):
         self.gpt = anaconda_flags.gpt
 
         self.multipath_friendly_names = anaconda_flags.mpathFriendlyNames
-        self.allow_degraded_mdraid = anaconda_flags.rescue_mode
+        self.allow_imperfect_devices = anaconda_flags.rescue_mode
 
         self.ibft = anaconda_flags.ibft
         self.dmraid = anaconda_flags.dmraid
-- 
1.9.3



More information about the anaconda-patches mailing list