From 4bb4c432dc17139b4f891d0fda229007b4913c0d Mon Sep 17 00:00:00 2001 From: Alfredo Deza Date: Thu, 10 Aug 2017 09:11:58 -0400 Subject: [PATCH] ceph-volume: is_mounted should use a bytes->string util to compare strings Signed-off-by: Alfredo Deza --- src/ceph-volume/ceph_volume/util/system.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ceph-volume/ceph_volume/util/system.py b/src/ceph-volume/ceph_volume/util/system.py index b633e9343d91..084a0e0d3710 100644 --- a/src/ceph-volume/ceph_volume/util/system.py +++ b/src/ceph-volume/ceph_volume/util/system.py @@ -4,6 +4,7 @@ import pwd import platform import uuid from ceph_volume import process +from . import as_string # TODO: get these out of here and into a common area for others to consume @@ -94,10 +95,10 @@ def is_mounted(source, destination=None): mounted_path = fields[1] if os.path.isabs(mounted_device) and os.path.exists(mounted_device): mounted_device = os.path.realpath(mounted_device) - if mounted_device == dev: + if as_string(mounted_device) == dev: if destination: destination = os.path.realpath(destination) - return destination == os.path.realpath(mounted_path) + return destination == as_string(os.path.realpath(mounted_path)) else: return True return False -- 2.47.3