diff options
author | Joel Granados Moreno <jgranado@redhat.com> | 2009-03-09 15:12:22 +0100 |
---|---|---|
committer | Joel Granados Moreno <jgranado@redhat.com> | 2009-03-10 18:43:32 +0100 |
commit | ad45eb81594164d85f22b0143e4514ccbbeef940 (patch) | |
tree | a17d310426c999d65a68de7ccccdefcee0d8e46f /storage/devicelibs/dm.py | |
parent | 02821c4cb57396c2eb4e74e7b463f5830878ee8c (diff) | |
download | anaconda-ad45eb81594164d85f22b0143e4514ccbbeef940.tar.gz anaconda-ad45eb81594164d85f22b0143e4514ccbbeef940.tar.xz anaconda-ad45eb81594164d85f22b0143e4514ccbbeef940.zip |
Use the pyblock functions when possible.
* storage/devicelibs/dm.py : For each function that is used in the
storage code, we try to use pyblock first. We fail to calling
dmsetup.
* storage/devices.py : Erased the commented line that had the
pyblock call. We are doing all the pyblock calls from
storage/devicelibs/dm.py.
* storage/devicetree.py : likewise.
* storage/formats/dmraid.py : likewise.
Diffstat (limited to 'storage/devicelibs/dm.py')
-rw-r--r-- | storage/devicelibs/dm.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/storage/devicelibs/dm.py b/storage/devicelibs/dm.py index 74d8228de..29df1266e 100644 --- a/storage/devicelibs/dm.py +++ b/storage/devicelibs/dm.py @@ -22,6 +22,7 @@ import os +import block import iutil from ..errors import * @@ -32,6 +33,10 @@ import logging log = logging.getLogger("storage") def name_from_dm_node(dm_node): + name = block.getNameFromDmNode(dm_node) + if name is not None: + return name + st = os.stat("/dev/%s" % dm_node) major = os.major(st.st_rdev) minor = os.minor(st.st_rdev) @@ -44,6 +49,10 @@ def name_from_dm_node(dm_node): return name.strip() def dm_node_from_name(map_name): + dm_node = block.getDmNodeFromName(map_name) + if dm_node is not None: + return dm_node + devnum = iutil.execWithCapture("dmsetup", ["info", "--columns", "--noheadings", |