Re: [PATCH] Make sure we use the newly committed parted.Partition after create.

[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 added created a new parted.Partition to add to the disk, so now
our _partedPartition attribute is outdated. Setting the attribute
to None forces a lookup on the next access, which will sort us out.
---
  storage/devices.py |   18 ++++--------------
  1 files changed, 4 insertions(+), 14 deletions(-)

diff --git a/storage/devices.py b/storage/devices.py
index b80eb76..cb0ba38 100644
--- a/storage/devices.py
+++ b/storage/devices.py
@@ -1024,22 +1024,12 @@ class PartitionDevice(StorageDevice):
          self.createParents()
          self.setupParents()

-        # If we are bootable or our format has a flag it needs set, do
-        # that now.
-        #
-        # FIXME: this should be moved onto a common codepath so that
-        #        flags get set properly for existing partitions as well.
-        #
-        # XXX this may trigger multiple parted.Disk.commit() calls, but
-        #     who cares?
-        if self.format.partedFlag is not None:
-            self.setFlag(self.format.partedFlag)
-
-        if self.bootable:
-            self.setFlag(parted.PARTITION_BOOT)
-
          self.disk.addPartition(self)
          self.disk.commit()
+
+        # this will force a lookup on next access, which we want
+        self.partedPartition = None
+
          self.exists = True
          self.setup()



--
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