diff options
author | Andy Grover <agrover@redhat.com> | 2015-12-02 21:50:32 -0800 |
---|---|---|
committer | Andy Grover <agrover@redhat.com> | 2015-12-02 21:50:32 -0800 |
commit | 110d0482f837b36ab30490090dd28e6cd303f544 (patch) | |
tree | cfe40e0231fb3220b46238fef6941b33e0b20c27 | |
parent | 3f828e7971d035f455021d8011c3f7eafb3866fb (diff) | |
download | rtslib-fb-110d0482f837b36ab30490090dd28e6cd303f544.tar.gz |
Make sure get_size_for_blk_dev() works for symlinks
Now that we don't call realpath() in other places, we need to call it here,
because we really do need the real path here.
Signed-off-by: Andy Grover <agrover@redhat.com>
-rw-r--r-- | rtslib/utils.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/rtslib/utils.py b/rtslib/utils.py index 46f10c3..4cee7a5 100644 --- a/rtslib/utils.py +++ b/rtslib/utils.py @@ -117,6 +117,7 @@ def get_size_for_blk_dev(path): @type path: string @return: The size in logical blocks of the device ''' + path = os.path.realpath(str(path)) rdev = os.lstat(path).st_rdev maj, min = os.major(rdev), os.minor(rdev) |