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 User

 
 
LinkBack Thread Tools
 
Old 12-02-2010, 05:34 PM
David Lehman
 
Default Remove some unnecessarily hard-coded "/dev/mapper" strings.

---
pyanaconda/storage/devices.py | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/pyanaconda/storage/devices.py b/pyanaconda/storage/devices.py
index 86c40af..959cc62 100644
--- a/pyanaconda/storage/devices.py
+++ b/pyanaconda/storage/devices.py
@@ -1194,11 +1194,10 @@ class PartitionDevice(StorageDevice):
if not self.parents:
self.sysfsPath = '

- elif self.parents[0]._devDir == "/dev/mapper":
+ elif isinstance(self.parents[0], DMDevice):
dm_node = dm.dm_node_from_name(self.name)
path = os.path.join("/sys", self.sysfsBlockDir, dm_node)
self.sysfsPath = os.path.realpath(path)[4:]
-
else:
StorageDevice.updateSysfsPath(self)

@@ -1597,7 +1596,7 @@ class DMDevice(StorageDevice):
def setupPartitions(self):
log_method_call(self, name=self.name, kids=self.kids)
rc = iutil.execWithRedirect("kpartx",
- ["-a", "-p", "p", "/dev/mapper/%s" % self.name],
+ ["-a", "-p", "p", self.path],
stdout = "/dev/tty5",
stderr = "/dev/tty5")
if rc:
@@ -1607,7 +1606,7 @@ class DMDevice(StorageDevice):
def teardownPartitions(self):
log_method_call(self, name=self.name, kids=self.kids)
rc = iutil.execWithRedirect("kpartx",
- ["-d", "-p", "p", "/dev/mapper/%s" % self.name],
+ ["-d", "-p", "p", self.path],
stdout = "/dev/tty5",
stderr = "/dev/tty5")
if rc:
--
1.7.2.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 03:25 AM.

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