[PATCH 3/4] Use protected for pvs of incomplete vgs and get rid of immutable.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 pyanaconda/storage/__init__.py      |    9 +++++----
 pyanaconda/storage/devices.py       |    1 -
 pyanaconda/storage/devicetree.py    |    4 ++--
 pyanaconda/storage/formats/lvmpv.py |    2 ++
 pyanaconda/storage/partitioning.py  |    9 +--------
 5 files changed, 10 insertions(+), 15 deletions(-)

diff --git a/pyanaconda/storage/__init__.py b/pyanaconda/storage/__init__.py
index c0d9e6a..bc80c28 100644
--- a/pyanaconda/storage/__init__.py
+++ b/pyanaconda/storage/__init__.py
@@ -748,7 +748,8 @@ class Storage(object):
         if not isinstance(device, Device):
             raise ValueError("arg1 (%s) must be a Device instance" % device)
 
-        if not ignoreProtected and device.protected:
+        if not ignoreProtected and device.protected and \
+           not getattr(device.format, "inconsistentVG", False):
             return _("This partition is holding the data for the hard "
                       "drive install.")
         elif isinstance(device, PartitionDevice) and device.isProtected:
@@ -765,6 +766,9 @@ class Storage(object):
                     else:
                         return _("This device is part of a RAID device.")
         elif device.format.type == "lvmpv":
+            if device.format.inconsistentVG:
+                return _("This device is part of an inconsistent LVM "
+                         "Volume Group.")
             for vg in self.vgs:
                 if vg.dependsOn(device):
                     if vg.name is not None:
@@ -794,9 +798,6 @@ class Storage(object):
                     msg += "%s: %s" % (dev, reasons[dev])
                 return msg
 
-        if device.immutable:
-            return device.immutable
-
         return False
 
     def deviceDeps(self, device):
diff --git a/pyanaconda/storage/devices.py b/pyanaconda/storage/devices.py
index 5e970f7..6e702e7 100644
--- a/pyanaconda/storage/devices.py
+++ b/pyanaconda/storage/devices.py
@@ -480,7 +480,6 @@ class StorageDevice(Device):
         self.bus = bus
 
         self.protected = False
-        self.immutable = None
         self.controllable = True
 
         self.format = format
diff --git a/pyanaconda/storage/devicetree.py b/pyanaconda/storage/devicetree.py
index 9d04489..3807994 100644
--- a/pyanaconda/storage/devicetree.py
+++ b/pyanaconda/storage/devicetree.py
@@ -1656,8 +1656,8 @@ class DeviceTree(object):
                     devicelibs.lvm.blacklistVG(device.name)
                     for parent in device.parents:
                         if parent.type == "partition":
-                            parent.immutable = \
-                                _("This partition is part of an inconsistent LVM Volume Group.")
+                            parent.format.inconsistentVG = True
+                            parent.protected = True
                         else:
                             self._removeDevice(parent, moddisk=False)
                             self.addIgnoredDisk(parent.name)
diff --git a/pyanaconda/storage/formats/lvmpv.py b/pyanaconda/storage/formats/lvmpv.py
index e23cb81..5a6bc3e 100644
--- a/pyanaconda/storage/formats/lvmpv.py
+++ b/pyanaconda/storage/formats/lvmpv.py
@@ -67,6 +67,8 @@ class LVMPhysicalVolume(DeviceFormat):
         # for not-yet-created devices
         self.peStart = kwargs.get("peStart", 1.0)    # in MB
 
+        self.inconsistentVG = False
+
     def __repr__(self):
         s = DeviceFormat.__repr__(self)
         s += ("  vgName = %(vgName)s  vgUUID = %(vgUUID)s"
diff --git a/pyanaconda/storage/partitioning.py b/pyanaconda/storage/partitioning.py
index 38bb513..85d4c29 100644
--- a/pyanaconda/storage/partitioning.py
+++ b/pyanaconda/storage/partitioning.py
@@ -391,10 +391,6 @@ def shouldClear(device, clearPartType, clearPartDisks=None):
     if device.protected:
         return False
 
-    # Don't clear immutable devices.
-    if device.immutable:
-        return False
-
     return True
 
 def clearPartitions(storage, bootloader=None):
@@ -486,11 +482,8 @@ def clearPartitions(storage, bootloader=None):
             disk.name not in storage.config.clearPartDisks):
             continue
 
-        # Don't touch immutable disks
-        if disk.immutable:
-            continue
-
         # don't reinitialize the disklabel if the disk contains install media
+        # or pvs from inconsistent vgs
         if filter(lambda p: p.dependsOn(disk), storage.protectedDevices):
             continue
 
-- 
1.7.3.4

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


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux