From: Alfredo Deza Date: Thu, 10 Aug 2017 13:11:58 +0000 (-0400) Subject: ceph-volume: is_mounted should use a bytes->string util to compare strings X-Git-Tag: v13.0.0~152^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F16962%2Fhead;p=ceph.git ceph-volume: is_mounted should use a bytes->string util to compare strings Signed-off-by: Alfredo Deza --- 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