summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Jones <pjones@redhat.com>2010-02-26 13:33:22 -0500
committerPeter Jones <pjones@redhat.com>2010-02-26 13:33:22 -0500
commit893b9e9cd3f3ab8cd2f8429387b8c3051dbd194d (patch)
tree969eadddae569debc408c79c5740c1bc71d28be0
parenta24e722ebcb06c88f88605190caebdcf83236690 (diff)
downloadanaconda-893b9e9cd3f3ab8cd2f8429387b8c3051dbd194d.tar.gz
anaconda-893b9e9cd3f3ab8cd2f8429387b8c3051dbd194d.tar.xz
anaconda-893b9e9cd3f3ab8cd2f8429387b8c3051dbd194d.zip
Revert "working on this"
This reverts commit a24e722ebcb06c88f88605190caebdcf83236690.
-rw-r--r--iw/account_gui.py2
-rw-r--r--storage/devicelibs/mpath.py2
-rw-r--r--storage/devices.py65
-rw-r--r--storage/devicetree.py15
-rw-r--r--storage/udev.py8
5 files changed, 21 insertions, 71 deletions
diff --git a/iw/account_gui.py b/iw/account_gui.py
index 11d8fd11d..778a5fdc7 100644
--- a/iw/account_gui.py
+++ b/iw/account_gui.py
@@ -127,7 +127,7 @@ class AccountWindow (InstallWindow):
ret = self.intf.messageWindow(_("Weak Password"),
_("You have provided a weak password: %s") % msg,
type="custom", custom_icon="error",
- custom_buttons=[_("Cancel"), _("_Use Anyway")])
+ custom_buttons=[_("Cancel"), _("Use Anyway")])
if ret == 0:
self.passwordError()
diff --git a/storage/devicelibs/mpath.py b/storage/devicelibs/mpath.py
index 1e2c2c821..75911c9a1 100644
--- a/storage/devicelibs/mpath.py
+++ b/storage/devicelibs/mpath.py
@@ -137,7 +137,7 @@ def identifyMultipaths(devices):
non_disk_serials[serial].append(device)
for mpath in multipaths:
- for serial in [d.get('ID_SERIAL') for d in mpath]:
+ for serial in [d.get('ID_SERIAL_SHORT') for d in mpath]:
if non_disk_serials.has_key(serial):
log.info("filtering out non disk devices [%s]" % [d['name'] for d in non_disk_serials[serial]])
for name in [d['name'] for d in non_disk_serials[serial]]:
diff --git a/storage/devices.py b/storage/devices.py
index 6f2e55c56..898273040 100644
--- a/storage/devices.py
+++ b/storage/devices.py
@@ -430,8 +430,7 @@ class StorageDevice(Device):
def __init__(self, device, format=None,
size=None, major=None, minor=None,
- sysfsPath='', parents=None, exists=None,
- serial=None, serial_short=None,
+ sysfsPath='', parents=None, exists=None, serial=None,
vendor="", model="", bus=""):
""" Create a StorageDevice instance.
@@ -447,8 +446,7 @@ class StorageDevice(Device):
sysfsPath -- sysfs device path
format -- a DeviceFormat instance
parents -- a list of required Device instances
- serial -- the ID_SERIAL for this device
- serial_short -- the ID_SERIAL_SHORT for this device
+ serial -- the ID_SERIAL_SHORT for this device
vendor -- the manufacturer of this Device
model -- manufacturer's device model string
bus -- the interconnect this device uses
@@ -468,7 +466,6 @@ class StorageDevice(Device):
self.minor = numeric_type(minor)
self.sysfsPath = sysfsPath
self._serial = serial
- self._serial_short = serial_short
self._vendor = vendor
self._model = model
self.bus = bus
@@ -757,15 +754,8 @@ class StorageDevice(Device):
return self._serial
@property
- def serial_short(self):
- return self._serial_short
-
- @property
def serial_for_display(self):
- try:
- return self.serial_short
- except NotImplementedError:
- return self.serial
+ return self.serial
@property
def model(self):
@@ -785,8 +775,7 @@ class DiskDevice(StorageDevice):
def __init__(self, device, format=None,
size=None, major=None, minor=None, sysfsPath='',
- parents=None, serial=None, serial_short=None,
- vendor="", model="", bus="",
+ parents=None, serial=None, vendor="", model="", bus="",
exists=True):
""" Create a DiskDevice instance.
@@ -803,8 +792,7 @@ class DiskDevice(StorageDevice):
format -- a DeviceFormat instance
parents -- a list of required Device instances
removable -- whether or not this is a removable device
- serial -- the ID_SERIAL for this device
- serial_short -- the ID_SERIAL_SHORT for this device
+ serial -- the ID_SERIAL_SHORT for this device
vendor -- the manufacturer of this Device
model -- manufacturer's device model string
bus -- the interconnect this device uses
@@ -815,8 +803,8 @@ class DiskDevice(StorageDevice):
StorageDevice.__init__(self, device, format=format, size=size,
major=major, minor=minor, exists=exists,
sysfsPath=sysfsPath, parents=parents,
- serial=serial, serial_short=serial_short,
- model=model, vendor=vendor, bus=bus)
+ serial=serial, model=model,
+ vendor=vendor, bus=bus)
def __str__(self):
s = StorageDevice.__str__(self)
@@ -1515,18 +1503,6 @@ class DMDevice(StorageDevice):
return getattr(self, "_serial", "")
@property
- def serial_short(self):
- if self._serial_short:
- return self._serial_short
- try:
- serial_short = getattr(self, "_getSerialShort")()
- except:
- raise NotImplementedError("serial_short method not defined for Device")
-
- self._serial_short = serial_short
- return getattr(self, "_serial_short", "")
-
- @property
def fstabSpec(self):
""" Return the device specifier for use in /etc/fstab. """
return self.path
@@ -1605,7 +1581,7 @@ class DMCryptDevice(DMDevice):
"""
DMDevice.__init__(self, name, format=format, size=size,
parents=parents, sysfsPath=sysfsPath,
- exists=exists, target="crypt", dmUuid=uuid)
+ exists=exists, target="crypt")
class LUKSDevice(DMCryptDevice):
""" A mapped LUKS device. """
@@ -3023,9 +2999,8 @@ class MultipathDevice(DMDevice):
_packages = ["device-mapper-multipath"]
_partitionable = True
_isDisk = True
- _resizable = False
- def __init__(self, name, info, format=None,
+ def __init__(self, name, info, format=None, size=None,
parents=None, sysfsPath=''):
""" Create a MultipathDevice instance.
@@ -3042,12 +3017,8 @@ class MultipathDevice(DMDevice):
parents -- a list of the backing devices (Device instances)
"""
+ self._info = info
dmUuid="mpath-%s" % info['ID_SERIAL']
- size=None
- for parent in parents:
- if parent.size:
- size = parent.size
- break
DMDevice.__init__(self, name, format=format, size=size,
parents=parents, sysfsPath=sysfsPath,
exists=True, dmUuid=dmUuid)
@@ -3060,10 +3031,6 @@ class MultipathDevice(DMDevice):
'gid' : '0',
}
- @property
- def size(self):
- return self._size
-
def _getWwidFromSerial(self, serial):
wwid = []
while serial:
@@ -3072,8 +3039,8 @@ class MultipathDevice(DMDevice):
wwid = ":".join(wwid)
return wwid
- def _getSerialShort(self):
- serial = self._getSerial()
+ def _getSerial(self):
+ serial = DMDevice._getSerial(self)
if not serial:
return None
@@ -3085,11 +3052,11 @@ class MultipathDevice(DMDevice):
@property
def wwid(self):
- if not self._serial_short:
- self._serial_short = self._getSerialShort()
- if not self._serial_short:
+ if not self._serial:
+ self._serial = self._getSerial()
+ if not self._serial:
return ""
- return self._getWwidFromSerial(self._serial_short)
+ return self._getWwidFromSerial(self._serial)
@property
def serial_for_display(self):
diff --git a/storage/devicetree.py b/storage/devicetree.py
index 586fc3383..386d23f82 100644
--- a/storage/devicetree.py
+++ b/storage/devicetree.py
@@ -1117,26 +1117,16 @@ class DeviceTree(object):
uuid = udev_device_get_uuid(info)
sysfs_path = udev_device_get_sysfs_path(info)
serial = udev_device_get_serial(info)
- serial_short = udev_device_get_serial_short(info)
bus = udev_device_get_bus(info)
# udev doesn't always provide a vendor.
vendor = udev_device_get_vendor(info)
if not vendor:
vendor = ""
- model = udev_device_get_model(info)
- if not model:
- model = ""
device = None
- kwargs = {
- "serial": serial,
- "serial_short": serial_short,
- "vendor": vendor,
- "model": model,
- "bus": bus
- }
+ kwargs = { "serial": serial, "vendor": vendor, "bus": bus }
if udev_device_is_iscsi(info):
diskType = iScsiDiskDevice
kwargs["node"] = self.iscsi.getNode(
@@ -1226,7 +1216,6 @@ class DeviceTree(object):
minor=udev_device_get_minor(info),
sysfsPath=sysfs_path, exists=True,
serial=udev_device_get_serial(info),
- serial_short=udev_device_get_serial_short(info),
vendor=udev_device_get_vendor(info),
model=udev_device_get_model(info))
self._addDevice(device)
@@ -1692,7 +1681,6 @@ class DeviceTree(object):
label = udev_device_get_label(info)
format_type = udev_device_get_format(info)
serial = udev_device_get_serial(info)
- serial_short = udev_device_get_serial_short(info)
# Now, if the device is a disk, see if there is a usable disklabel.
# If not, see if the user would like to create one.
@@ -1722,7 +1710,6 @@ class DeviceTree(object):
"label": label,
"device": device.path,
"serial": serial,
- "serial_short": serial_short,
"exists": True}
# set up type-specific arguments for the format constructor
diff --git a/storage/udev.py b/storage/udev.py
index d7c5c930f..02a54e737 100644
--- a/storage/udev.py
+++ b/storage/udev.py
@@ -241,18 +241,14 @@ def udev_device_is_partition(info):
has_start = os.path.exists("/sys/%s/start" % info['sysfs_path'])
return info.get("DEVTYPE") == "partition" or has_start
-def udev_device_get_serial_short(udev_info):
- """ Get the serial number/UUID from the device as reported by udev. """
- return udev_info.get("ID_SERIAL_SHORT", udev_info.get("ID_SERIAL"))
-
def udev_device_get_serial(udev_info):
""" Get the serial number/UUID from the device as reported by udev. """
- return udev_info.get("ID_SERIAL")
+ return udev_info.get("ID_SERIAL_SHORT", udev_info.get("ID_SERIAL"))
def udev_device_get_wwid(udev_info):
""" The WWID of a device is typically just its serial number, but with
colons in the name to make it more readable. """
- serial = udev_device_get_serial_short(udev_info)
+ serial = udev_device_get_serial(udev_info)
if serial and len(serial) == 32:
retval = ""