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

 
 
LinkBack Thread Tools
 
Old 12-09-2010, 08:16 PM
David Cantrell
 
Default Create a MainframeDiskDevice class for common s390 attributes.

Create a MainframeDiskDevice class to hold common s390 attributes
across the disk types specific to that platform. For now, it
does not do much except return self.desc for chreipl failures.
Oh, and build self.desc for DASDDevice and ZFCPDiskDevice which
is a slightly more human-readable string explaining where this
particular device lives on the system in z-speak.

Related: rhbz#632325
---
storage/devices.py | 24 +++++++++++++++++++-----
1 files changed, 19 insertions(+), 5 deletions(-)

diff --git a/storage/devices.py b/storage/devices.py
index 7d7dd51..72bcf2e 100644
--- a/storage/devices.py
+++ b/storage/devices.py
@@ -3581,7 +3581,15 @@ class OpticalDevice(StorageDevice):
os.close(fd)


-class ZFCPDiskDevice(DiskDevice):
+class MainframeDiskDevice(DiskDevice):
+ """ Abstract mainframe disk. """
+ _type = "mainframe"
+
+ def reIPLDescription(self):
+ return self.desc
+
+
+class ZFCPDiskDevice(MainframeDiskDevice):
""" A mainframe ZFCP disk. """
_type = "zfcp"

@@ -3589,10 +3597,15 @@ class ZFCPDiskDevice(DiskDevice):
self.hba_id = kwargs.pop("hba_id")
self.wwpn = kwargs.pop("wwpn")
self.fcp_lun = kwargs.pop("fcp_lun")
- DiskDevice.__init__(self, device, **kwargs)
+ self.desc = _("FCP device %(device)s with WWPN %(wwpn)s "
+ "and LUN %(lun)s"
+ % {'device': self.hba_id,
+ 'wwpn': self.wwpn,
+ 'lun': self.fcp_lun})
+ MainframeDiskDevice.__init__(self, device, **kwargs)

def __str__(self):
- s = DiskDevice.__str__(self)
+ s = MainframeDiskDevice.__str__(self)
s += (" hba_id = %(hba_id)s wwpn = %(wwpn)s fcp_lun = %(fcp_lun)s" %
{"hba_id": self.hba_id,
"wwpn": self.wwpn,
@@ -3603,7 +3616,7 @@ class ZFCPDiskDevice(DiskDevice):
return "rd_ZFCP=%s,%s,%s" % (self.hba_id, self.wwpn, self.fcp_lun,)


-class DASDDevice(DiskDevice):
+class DASDDevice(MainframeDiskDevice):
""" A mainframe DASD. """
_type = "dasd"

@@ -3611,7 +3624,8 @@ class DASDDevice(DiskDevice):
self.busid = kwargs.pop('busid')
self.opts = kwargs.pop('opts')
self.dasd = kwargs.pop('dasd')
- DiskDevice.__init__(self, device, **kwargs)
+ self.desc = _("DASD device %s" % self.busid)
+ MainframeDiskDevice.__init__(self, device, **kwargs)

if self.dasd:
self.dasd.addDASD(self)
--
1.7.3.2

_______________________________________________
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 06:14 AM.

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