summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Grover <agrover@redhat.com>2015-11-24 14:54:21 -0800
committerAndy Grover <agrover@redhat.com>2015-11-24 14:54:21 -0800
commit5afe6d98dc23b050a7649150fdf8e09dfba367c1 (patch)
tree5f03d61ac06af6048c74202a73912f7dea4c6135
parent7ccca210c7f00176cfcf2aa2f40df3d0ee9c5a30 (diff)
downloadrtslib-fb-5afe6d98dc23b050a7649150fdf8e09dfba367c1.tar.gz
Do not use realpath() on fileio paths
RBD creates block device nodes named /dev/rbd0 -> rbdX, but these may refer to different volumes after reboot. Users should use consistent names like /dev/rbd/foo/bar, these are symlinks to rbdX. rtslib should not use realpath() to get the rbdX name, but should just use what was given, which may be a symlink, but it will point to the right rbdX. Resolves #57 Signed-off-by: Andy Grover <agrover@redhat.com>
-rw-r--r--rtslib/tcm.py3
1 files changed, 0 insertions, 3 deletions
diff --git a/rtslib/tcm.py b/rtslib/tcm.py
index f8279b3..941db1c 100644
--- a/rtslib/tcm.py
+++ b/rtslib/tcm.py
@@ -565,8 +565,6 @@ class FileIOStorageObject(StorageObject):
def _configure(self, dev, size, wwn, write_back):
self._check_self()
-
- dev = os.path.realpath(dev)
block_type = get_blockdev_type(dev)
if block_type is None: # a file
if os.path.exists(dev) and not os.path.isfile(dev):
@@ -816,7 +814,6 @@ class StorageObjectFactory(object):
"""
def __new__(cls, path):
- path = os.path.realpath(path)
name = path.strip("/").replace("/", "-")
if os.path.exists(path):
s = os.stat(path)