Re: [PATCH] Don't let device names affect action order in general case.

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

 



Looks good.

On 04/02/2009 04:44 PM, David Lehman wrote:
Some complex action sets were being sorted incorrectly because of
the name comparisons. Names should only matter if both devices are
partitions on the same disk.
---
  storage/devicetree.py |   10 +++++-----
  1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/storage/devicetree.py b/storage/devicetree.py
index 9b059b6..288e12d 100644
--- a/storage/devicetree.py
+++ b/storage/devicetree.py
@@ -531,7 +531,7 @@ class DeviceTree(object):
                       not isinstance(a1.device, DiskDevice):
                      ret = -1
                  else:
-                    ret = cmp(a2.device.name, a1.device.name)
+                    ret = 0
              elif a1.isDestroy():
                  ret = -1
              elif a2.isDestroy():
@@ -580,7 +580,7 @@ class DeviceTree(object):
                      else:
                          ret = -1
                  else:
-                    ret = cmp(a1.device.name, a2.device.name)
+                    ret = 0
              elif a1.isResize():
                  ret = -1
              elif a2.isResize():
@@ -594,7 +594,7 @@ class DeviceTree(object):
                      elif a2.isFormat():
                          ret = -1
                      else:
-                        ret = cmp(a1.device.name, a2.device.name)
+                        ret = 0
                  elif a1.device.dependsOn(a2.device):
                      ret = 1
                  elif a2.device.dependsOn(a1.device):
@@ -610,7 +610,7 @@ class DeviceTree(object):
                       not isinstance(a1.device, DiskDevice):
                      ret = 1
                  else:
-                    ret = cmp(a1.device.name, a2.device.name)
+                    ret = 0
              elif a1.isCreate():
                  ret = -1
              elif a2.isCreate():
@@ -628,7 +628,7 @@ class DeviceTree(object):
                  else:
                      ret = cmp(a1.device.name, a2.device.name)
              else:
-                ret = cmp(a1.device.name, a2.device.name)
+                ret = 0

              log.debug("cmp: %d -- %s | %s" % (ret, a1, a2))
              return ret


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