diff options
author | Andy Grover <agrover@redhat.com> | 2015-04-28 12:23:09 -0700 |
---|---|---|
committer | Andy Grover <agrover@redhat.com> | 2015-04-28 12:23:09 -0700 |
commit | a5b4ac3b081393a1229f6f31ce6c082beb0c2f11 (patch) | |
tree | 7a311bf0b51873d815daba67a00ceb0854e167f7 /rtslib | |
parent | 10272d59aea2ea21b909254d2a11b841d1cf8d6f (diff) | |
download | rtslib-fb-a5b4ac3b081393a1229f6f31ce6c082beb0c2f11.tar.gz |
Always use realpath when creating file storage objects
Let there be no doubt the path to the open backing file or block device.
Signed-off-by: Andy Grover <agrover@redhat.com>
Diffstat (limited to 'rtslib')
-rw-r--r-- | rtslib/tcm.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/rtslib/tcm.py b/rtslib/tcm.py index 4d869f7..43b412e 100644 --- a/rtslib/tcm.py +++ b/rtslib/tcm.py @@ -564,9 +564,10 @@ 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(os.path.realpath(dev)) and not os.path.isfile(dev): + if os.path.exists(dev) and not os.path.isfile(dev): raise RTSLibError("Path not to a file or block device") if size is None: |