FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora Development

 
 
LinkBack Thread Tools
 
Old 12-16-2010, 07:59 AM
Ales Kozumplik
 
Default sda is less then vda in compareDisks()

Related: rhbz#621175
---
storage/__init__.py | 31 +++++++++++++------------------
1 files changed, 13 insertions(+), 18 deletions(-)

diff --git a/storage/__init__.py b/storage/__init__.py
index 09dab1f..03c8f07 100644
--- a/storage/__init__.py
+++ b/storage/__init__.py
@@ -1180,6 +1180,17 @@ class Storage(object):
return self.fsset.rootDevice

def compareDisks(self, first, second):
+ def name_to_prio(name):
+ # the order is: hd < sd < vd or xvd < something else
+ if name.startswith("hd"):
+ return -1
+ elif name.startswith("sd"):
+ return 0
+ elif (name.startswith("vd") or name.startswith("xvd")):
+ return 1
+ else:
+ return 2
+
# if exactly one of the devices has a pcidev, prefer it
if bool(self.eddDict[first].pcidev) ^ bool(self.eddDict[second].pcidev):
if self.eddDict[first].pcidev:
@@ -1202,24 +1213,8 @@ class Storage(object):
if self.eddDict[second].biosdev:
return 1

- if first.startswith("hd"):
- type1 = 0
- elif first.startswith("sd"):
- type1 = 1
- elif (first.startswith("vd") or first.startswith("xvd")):
- type1 = -1
- else:
- type1 = 2
-
- if second.startswith("hd"):
- type2 = 0
- elif second.startswith("sd"):
- type2 = 1
- elif (second.startswith("vd") or second.startswith("xvd")):
- type2 = -1
- else:
- type2 = 2
-
+ type1 = name_to_prio(first)
+ type2 = name_to_prio(second)
if (type1 < type2):
return -1
elif (type1 > type2):
--
1.7.3.3

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

Thread Tools




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

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org