Re: [PATCH] Be explicit about resetting Disks' partedDisk attribute. (#489678)

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

 



Looks good.

On 03/11/2009 12:34 PM, David Lehman wrote:
We hit a case where the projected layout matches exactly the
preexisting layout, and so the equality test gives a false
positive due to pyparted's sneaky comparison methods. This
happens when you do autopart two or more times in a row on
a system.
---
  storage/devices.py    |    8 --------
  storage/devicetree.py |    5 +++++
  2 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/storage/devices.py b/storage/devices.py
index cb0ba38..ae1ad09 100644
--- a/storage/devices.py
+++ b/storage/devices.py
@@ -704,20 +704,12 @@ class DiskDevice(StorageDevice):

      def removePartition(self, device):
          log_method_call(self, self.name, part=device.name)
-        if self.partedDisk != self._origPartedDisk:
-            log.debug("going to reset self.partedDisk to actual state")
-            self.resetPartedDisk()
-
          partition = self.partedDisk.getPartitionByPath(device.path)
          if partition:
              self.partedDisk.removePartition(partition)

      def addPartition(self, device):
          log_method_call(self, self.name, part=device.name)
-        if self.partedDisk != self._origPartedDisk:
-            log.debug("going to reset self.partedDisk to actual state")
-            self.resetPartedDisk()
-
          for part in self.partedDisk.partitions:
              log.debug("disk %s: partition %s has geom %s" % (self.name,
                                                               part.getDeviceNodeName(),
diff --git a/storage/devicetree.py b/storage/devicetree.py
index d21883d..2a40fc4 100644
--- a/storage/devicetree.py
+++ b/storage/devicetree.py
@@ -607,6 +607,11 @@ class DeviceTree(object):
          for action in self._actions:
              log.debug("action: %s" % action)

+        log.debug("resetting parted disks...")
+        for device in self.devices.itervalues():
+            if isinstance(device, DiskDevice):
+                device.resetPartedDisk()
+
          for action in self._actions:
              log.info("executing action: %s" % action)
              if not dryRun:


--
David Cantrell <dcantrell@xxxxxxxxxx>
Red Hat / Honolulu, HI

_______________________________________________
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