From 48491bde5166a6af145e6343cc4344983b992a15 Mon Sep 17 00:00:00 2001 From: Dan van der Ster Date: Fri, 6 Mar 2015 11:37:32 +0100 Subject: [PATCH] ceph-disk: activate-[all|journal] should suppress Make the suppress-activate feature work for activate-all and activate-journal. Signed-off-by: Dan van der Ster --- src/ceph-disk | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/ceph-disk b/src/ceph-disk index c3c69514420..73990cc6e5f 100755 --- a/src/ceph-disk +++ b/src/ceph-disk @@ -2257,6 +2257,10 @@ def main_activate_journal(args): osd_uuid = get_journal_osd_uuid(args.dev) path = os.path.join('/dev/disk/by-partuuid/', osd_uuid.lower()) + if is_suppressed(path): + LOG.info('suppressed activate request on %s', path) + return + (cluster, osd_id) = mount_activate( dev=path, activate_key_template=args.activate_key_template, @@ -2293,6 +2297,10 @@ def main_activate_all(args): else: path = os.path.join(dir, name) + if is_suppressed(path): + LOG.info('suppressed activate request on %s', path) + continue + LOG.info('Activating %s', path) activate_lock.acquire() # noqa try: @@ -2631,7 +2639,7 @@ def main_list(args): def is_suppressed(path): disk = os.path.realpath(path) try: - if not disk.startswith('/dev/') or not stat.S_ISBLK(os.lstat(path).st_mode): + if not disk.startswith('/dev/') or not stat.S_ISBLK(os.lstat(disk).st_mode): return False base = get_dev_name(disk) while len(base):