diff options
author | Peter Jones <pjones@redhat.com> | 2009-10-09 15:48:57 -0400 |
---|---|---|
committer | Peter Jones <pjones@redhat.com> | 2009-10-12 14:39:55 -0400 |
commit | 1991123cc472d68b8caf0246024b1db20f0fa826 (patch) | |
tree | 23207c3a8a480c5e414e05249b7b0e04938c1807 | |
parent | 6e028d7c68c240289cf8de07b635c25a017c917f (diff) | |
download | anaconda-1991123cc472d68b8caf0246024b1db20f0fa826.tar.gz anaconda-1991123cc472d68b8caf0246024b1db20f0fa826.tar.xz anaconda-1991123cc472d68b8caf0246024b1db20f0fa826.zip |
Add MultipathDevice.updateSysfsPath()
MultipathDevice needs its own .updateSysfsPath(), because self.name is
"mpath0" but the sysfs directory is /sys/class/block/dm-0 .
-rw-r--r-- | storage/devices.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/storage/devices.py b/storage/devices.py index 61e40d3e0..2af2dc70a 100644 --- a/storage/devices.py +++ b/storage/devices.py @@ -2807,6 +2807,19 @@ class MultipathDevice(DiskDevice): self._isUp = False self._pyBlockMultiPath = None + def updateSysfsPath(self): + """ Update this device's sysfs path. """ + log_method_call(self, self.name, status=self.status) + if not self.exists: + raise DeviceError("device has not been created", self.name) + + if self.status: + dm_node = self.getDMNode() + path = os.path.join("/sys", self.sysfsBlockDir, dm_node) + self.sysfsPath = os.path.realpath(path)[4:] + else: + self.sysfsPath = '' + class NoDevice(StorageDevice): """ A nodev device for nodev filesystems like tmpfs. """ _type = "nodev" |