]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume: is_mounted should use a bytes->string util to compare strings 16970/head
authorAlfredo Deza <adeza@redhat.com>
Thu, 10 Aug 2017 13:11:58 +0000 (09:11 -0400)
committerAndrew Schoen <aschoen@redhat.com>
Thu, 10 Aug 2017 15:35:22 +0000 (10:35 -0500)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
(cherry picked from commit 4bb4c432dc17139b4f891d0fda229007b4913c0d)

src/ceph-volume/ceph_volume/util/system.py

index b633e9343d91989aa3a0d95aa7624ca33a431398..084a0e0d3710042a8b9d38aeaf530d1038c8ffd0 100644 (file)
@@ -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