Re: [PATCH 2/3] Re-implement the inconsistency functionality.

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

 



Hi,

Ok I didn't see the first time you just moved some stuff around without actually
making any changes looks good, and so does patch nr 3.

Regards,

Hans


On 04/15/2009 05:35 PM, Joel Granados wrote:
On Wed, Apr 15, 2009 at 04:06:07PM +0200, Hans de Goede wrote:
What does this buy us so close to F11 ?
that I can put the next patch in the function.
Looks like a too big change for a patch without
a matching BZ to me.

Regards,

Hans


On 04/15/2009 03:57 PM, Joel Granados Moreno wrote:
---
   storage/devicetree.py |  118 +++++++++++++++++++++++++-----------------------
   1 files changed, 61 insertions(+), 57 deletions(-)

diff --git a/storage/devicetree.py b/storage/devicetree.py
index 7540ff2..8bc6aa7 100644
--- a/storage/devicetree.py
+++ b/storage/devicetree.py
@@ -1476,7 +1476,7 @@ class DeviceTree(object):
           elif device.format.type == "lvmpv":
               self.handleUdevLVMPVFormat(info, device)

-    def _handleInconsistencies(self, device):
+    def _handleInconsistencies(self):
           def reinitializeVG(vg):
               # First we remove VG data
               try:
@@ -1498,65 +1498,70 @@ class DeviceTree(object):
                             "exists": parent.exists}
                   parent.format = formats.getFormat(*[""], **kwargs)

-        if device.type == "lvmvg":
-            paths = []
-            for parent in device.parents:
-                paths.append(parent.path)
-
-            # when zeroMbr is true he wont ask.
-            if not device.complete and (self.zeroMbr or \
-                    questionReinitILVM(intf=self.intf, \
-                        vg_name=device.name, pv_names=paths)):
-                reinitializeVG(device)
-
-            elif not device.complete:
-                # The user chose not to reinitialize.
-                # hopefully this will ignore the vg components too.
-                self._removeDevice(device)
-                lvm.lvm_cc_addFilterRejectRegexp(device.name)
-                lvm.blacklistVG(device.name)
+        def leafInconsistencies(device):
+            if device.type == "lvmvg":
+                paths = []
                   for parent in device.parents:
-                    self._removeDevice(parent, moddisk=False)
-                    lvm.lvm_cc_addFilterRejectRegexp(parent.name)
-
-            return
+                    paths.append(parent.path)
+
+                # when zeroMbr is true he wont ask.
+                if not device.complete and (self.zeroMbr or \
+                        questionReinitILVM(intf=self.intf, \
+                            vg_name=device.name, pv_names=paths)):
+                    reinitializeVG(device)
+
+                elif not device.complete:
+                    # The user chose not to reinitialize.
+                    # hopefully this will ignore the vg components too.
+                    self._removeDevice(device)
+                    lvm.lvm_cc_addFilterRejectRegexp(device.name)
+                    lvm.blacklistVG(device.name)
+                    for parent in device.parents:
+                        self._removeDevice(parent, moddisk=False)
+                        lvm.lvm_cc_addFilterRejectRegexp(parent.name)

-        elif device.type == "lvmlv":
-            # we might have already fixed this.
-            if device not in self._devices or \
-                    device.name in self._ignoredDisks:
                   return

-            paths = []
-            for parent in device.vg.parents:
-                paths.append(parent.path)
-
-            if not device.complete and (self.zeroMbr or \
-                questionReinitILVM(intf=self.intf, \
-                    lv_name=device.name, pv_names=paths)):
-
-                # destroy all lvs.
-                for lv in device.vg.lvs:
-                    lv.destroy()
-                    device.vg._removeLogVol(lv)
-                    self._removeDevice(lv)
-
-                reinitializeVG(device.vg)
-
-            elif not device.complete:
-                # ignore all the lvs.
-                for lv in device.vg.lvs:
-                    self._removeDevice(lv)
-                    lvm.lvm_cc_addFilterRejectRegexp(lv.name)
-                # ignore the vg
-                self._removeDevice(device.vg)
-                lvm.lvm_cc_addFilterRejectRegexp(device.vg.name)
-                lvm.blacklistVG(device.vg.name)
-                # ignore all the pvs
+            elif device.type == "lvmlv":
+                # we might have already fixed this.
+                if device not in self._devices or \
+                        device.name in self._ignoredDisks:
+                    return
+
+                paths = []
                   for parent in device.vg.parents:
-                    self._removeDevice(parent, moddisk=False)
-                    lvm.lvm_cc_addFilterRejectRegexp(parent.name)
-            return
+                    paths.append(parent.path)
+
+                if not device.complete and (self.zeroMbr or \
+                    questionReinitILVM(intf=self.intf, \
+                        lv_name=device.name, pv_names=paths)):
+
+                    # destroy all lvs.
+                    for lv in device.vg.lvs:
+                        lv.destroy()
+                        device.vg._removeLogVol(lv)
+                        self._removeDevice(lv)
+
+                    reinitializeVG(device.vg)
+
+                elif not device.complete:
+                    # ignore all the lvs.
+                    for lv in device.vg.lvs:
+                        self._removeDevice(lv)
+                        lvm.lvm_cc_addFilterRejectRegexp(lv.name)
+                    # ignore the vg
+                    self._removeDevice(device.vg)
+                    lvm.lvm_cc_addFilterRejectRegexp(device.vg.name)
+                    lvm.blacklistVG(device.vg.name)
+                    # ignore all the pvs
+                    for parent in device.vg.parents:
+                        self._removeDevice(parent, moddisk=False)
+                        lvm.lvm_cc_addFilterRejectRegexp(parent.name)
+                return
+
+        # Address the inconsistencies present in the tree leaves.
+        for leaf in self.leaves:
+            leafInconsistencies(leaf)

       def populate(self):
           """ Locate all storage devices. """
@@ -1589,8 +1594,7 @@ class DeviceTree(object):

           # After having the complete tree we make sure that the system
           # inconsistencies are ignored or resolved.
-        for leaf in self.leaves:
-            self._handleInconsistencies(leaf)
+        self._handleInconsistencies()

           self.teardownAll()
           try:
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


_______________________________________________
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