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

[PATCH] Sort singlePV=True requests so they come first.

As another way to ensure the singlePV asVol requests get full pick of
what PV they want to destroy, make sure they come before the regular
asVol requests.

(Code from Dave Lehman <dlehman redhat com>)

Related: rhbz#618376
 pyanaconda/storage/deviceaction.py |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/pyanaconda/storage/deviceaction.py b/pyanaconda/storage/deviceaction.py
index 47de6b8..0505941 100644
--- a/pyanaconda/storage/deviceaction.py
+++ b/pyanaconda/storage/deviceaction.py
@@ -24,7 +24,9 @@
 from udev import *
 import math
-from devices import StorageDevice, PartitionDevice
+from devices import StorageDevice
+from devices import PartitionDevice
+from devices import LVMLogicalVolumeDevice
 from formats import getFormat
 from errors import *
 from parted import partitionFlag, PARTITION_LBA
@@ -259,6 +261,12 @@ class ActionCreateDevice(DeviceAction):
             otherNum = action.device.partedPartition.number
             if selfNum > otherNum:
                 rc = True
+        elif (action.isCreate and action.isDevice and
+              isinstance(self.device, LVMLogicalVolumeDevice) and
+              isinstance(action.device, LVMLogicalVolumeDevice) and
+              self.device.vg == action.device.vg and
+              action.device.singlePV and not self.device.singlePV):
+            rc = True
         return rc

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