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 > Ubuntu > Ubuntu Studio User

 
 
LinkBack Thread Tools
 
Old 06-03-2010, 04:57 PM
Steffen Maier
 
Default Show by-path names for DASD and zFCP, WWID for mpath (#580507)

In the partition editor UI, we get device names for DASD as "dasda",
"dasdb", and so on. For zFCP, we get "sda", "sdb", and so on. The by-path
identifiers are more useful to s390 users, so display those on this
screen if we have them, otherwise fall back on the device path.

For mpath devices, try to display the WWID if we have it, otherwise show
the device path.

(Based on patch from David Cantrell <dcantrell@redhat.com>)
---
iw/partition_gui.py | 19 +++++++++++++++++--
1 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/iw/partition_gui.py b/iw/partition_gui.py
index be179dc..3773c5e 100644
--- a/iw/partition_gui.py
+++ b/iw/partition_gui.py
@@ -50,6 +50,8 @@ from storage.partitioning import doPartitioning
from storage.partitioning import hasFreeDiskSpace
from storage.devicelibs import lvm
from storage.devices import devicePathToName, PartitionDevice
+from storage.devices import deviceNameToDiskByPath
+from storage.errors import DeviceNotFoundError

import gettext
_ = lambda x: gettext.ldgettext("anaconda", x)
@@ -1090,15 +1092,28 @@ class PartitionWindow(InstallWindow):
# whole-disk formatting
self.addDevice(disk, parent)

+ ident = None
+ try:
+ if disk.type == "dasd" or disk.type == "zfcp":
+ ident = deviceNameToDiskByPath(disk.name)
+ if ident.startswith("/dev/disk/by-path/"):
+ ident = ident.replace("/dev/disk/by-path/", "")
+ elif disk.type == "dm-multipath":
+ ident = disk.wwid
+ except DeviceNotFoundError:
+ ident = None
+ if not ident:
+ ident = disk.path
+
# Insert a '
' when device string is too long. Usually when it
# contains '/dev/mapper'. First column should be around 20 chars.
- if len(disk.name) + len(disk.path) > 20:
+ if len(disk.name) + len(ident) > 20:
separator = "
"
else:
separator= " "
self.tree[parent]['Device'] =
"%s%s<span size="small" color="gray">(%s)</span>"
- % (disk.name, separator, disk.path)
+ % (disk.name, separator, ident)

self.treeView.expand_all()
self.messageGraph.display()
--
1.7.0.4


_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 06-14-2010, 06:26 PM
David Cantrell
 
Default Show by-path names for DASD and zFCP, WWID for mpath (#580507)

Ack. I have applied this with minor changes (I do not like the use of
.replace and prefer os.path.basename instead).

On Thu, 3 Jun 2010, Steffen Maier wrote:


In the partition editor UI, we get device names for DASD as "dasda",
"dasdb", and so on. For zFCP, we get "sda", "sdb", and so on. The by-path
identifiers are more useful to s390 users, so display those on this
screen if we have them, otherwise fall back on the device path.

For mpath devices, try to display the WWID if we have it, otherwise show
the device path.

(Based on patch from David Cantrell <dcantrell@redhat.com>)
---
iw/partition_gui.py | 19 +++++++++++++++++--
1 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/iw/partition_gui.py b/iw/partition_gui.py
index be179dc..3773c5e 100644
--- a/iw/partition_gui.py
+++ b/iw/partition_gui.py
@@ -50,6 +50,8 @@ from storage.partitioning import doPartitioning
from storage.partitioning import hasFreeDiskSpace
from storage.devicelibs import lvm
from storage.devices import devicePathToName, PartitionDevice
+from storage.devices import deviceNameToDiskByPath
+from storage.errors import DeviceNotFoundError

import gettext
_ = lambda x: gettext.ldgettext("anaconda", x)
@@ -1090,15 +1092,28 @@ class PartitionWindow(InstallWindow):
# whole-disk formatting
self.addDevice(disk, parent)

+ ident = None
+ try:
+ if disk.type == "dasd" or disk.type == "zfcp":
+ ident = deviceNameToDiskByPath(disk.name)
+ if ident.startswith("/dev/disk/by-path/"):
+ ident = ident.replace("/dev/disk/by-path/", "")
+ elif disk.type == "dm-multipath":
+ ident = disk.wwid
+ except DeviceNotFoundError:
+ ident = None
+ if not ident:
+ ident = disk.path
+
# Insert a '
' when device string is too long. Usually when it
# contains '/dev/mapper'. First column should be around 20 chars.
- if len(disk.name) + len(disk.path) > 20:
+ if len(disk.name) + len(ident) > 20:
separator = "
"
else:
separator= " "
self.tree[parent]['Device'] =
"%s%s<span size="small" color="gray">(%s)</span>"
- % (disk.name, separator, disk.path)
+ % (disk.name, separator, ident)

self.treeView.expand_all()
self.messageGraph.display()



--
David Cantrell <dcantrell@redhat.com>
Red Hat / Honolulu, HI

_______________________________________________
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:44 PM.

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