Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   CentOS (http://www.linux-archive.org/centos/)
-   -   Schedule actions when removing existing extended partitions. (#568219) (http://www.linux-archive.org/centos/360672-schedule-actions-when-removing-existing-extended-partitions-568219-a.html)

David Lehman 04-22-2010 09:21 PM

Schedule actions when removing existing extended partitions. (#568219)
 
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:
--
1.6.2.5

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

David Cantrell 04-22-2010 09:27 PM

Schedule actions when removing existing extended partitions. (#568219)
 
-----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@redhat.com>

Red Hat / Honolulu, HI

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

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

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


All times are GMT. The time now is 10:09 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.