Re: [PATCH 2/3] Schedule actions when removing existing extended partitions. (#568219)

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

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Looks good.  568219 is a Fedora bug, so please clone that for RHEL-6 and
reference it on the rhel6-branch commit.

On Thu, 22 Apr 2010, David Lehman wrote:

If removing an extended partition that we created ourselves, we only
need to remove the device from the tree. If the device is preexisting
we need a destroy action to remove it, even if its removal was not
explicitly requested.
---
storage/partitioning.py |   12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/storage/partitioning.py b/storage/partitioning.py
index 887ecbb..62e338e 100644
--- a/storage/partitioning.py
+++ b/storage/partitioning.py
@@ -812,15 +812,21 @@ def doPartitioning(storage, exclusiveDisks=None):
            # remove any obsolete extended partitions
            for part in storage.partitions:
                if part.disk == disk and part.isExtended:
-                    storage.devicetree._removeDevice(part, moddisk=False)
+                    if part.exists:
+                        storage.destroyDevice(part)
+                    else:
+                        storage.devicetree._removeDevice(part, moddisk=False)
            continue

        extendedName = devicePathToName(extended.getDeviceNodeName())
        # remove any obsolete extended partitions
        for part in storage.partitions:
            if part.disk == disk and part.isExtended and \
-               part.name != extendedName:
-                storage.devicetree._removeDevice(part, moddisk=False)
+               part.partedPartition not in disk.format.partitions:
+                if part.exists:
+                    storage.destroyDevice(part)
+                else:
+                    storage.devicetree._removeDevice(part, moddisk=False)

        device = storage.devicetree.getDeviceByName(extendedName)
        if device:


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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAkvQv0MACgkQ5hsjjIy1VklH6gCglwCFdB+ygFN5ycWT5dEY4Jc2
Gf0An3BOrHV0eqjZS0OFsBlwzS+60k8c
=2c1R
-----END PGP SIGNATURE-----

_______________________________________________
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