From: Sage Weil Date: Tue, 21 May 2013 19:52:03 +0000 (-0700) Subject: ceph-disk: fix stat errors with new suppress code X-Git-Tag: v0.64~79 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bcc8bfdb672654c6a6b48a2aa08267a894debc32;p=ceph.git ceph-disk: fix stat errors with new suppress code Broken by 225fefe5e7c997b365f481b6c4f66312ea28ed61. Signed-off-by: Sage Weil --- diff --git a/src/ceph-disk b/src/ceph-disk index 3c105463ed86..54c9445045a6 100755 --- a/src/ceph-disk +++ b/src/ceph-disk @@ -1820,9 +1820,9 @@ SUPPRESS_PREFIX='/var/lib/ceph/tmp/suppress-activate.' def is_suppressed(path): disk = os.path.realpath(path) - if not disk.startswith('/dev/') or not stat.S_ISBLK(os.lstat(path)): - return False try: + if not disk.startswith('/dev/') or not stat.S_ISBLK(os.lstat(path).st_mode): + return False base = disk[5:] while len(base): if os.path.exists(SUPPRESS_PREFIX + base): @@ -1835,7 +1835,7 @@ def set_suppress(path): disk = os.path.realpath(path) if not os.path.exists(disk): raise Error('does not exist', path); - if not stat.S_ISBLK(os.lstat(path)): + if not stat.S_ISBLK(os.lstat(path).st_mode): raise Error('not a block device', path) base = disk[5:] @@ -1847,7 +1847,7 @@ def unset_suppress(path): disk = os.path.realpath(path) if not os.path.exists(disk): raise Error('does not exist', path); - if not stat.S_ISBLK(os.lstat(path)): + if not stat.S_ISBLK(os.lstat(path).st_mode): raise Error('not a block device', path) assert disk.startswith('/dev/') base = disk[5:]