]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-disk: activate-[all|journal] should suppress 3892/head
authorDan van der Ster <daniel.vanderster@cern.ch>
Fri, 6 Mar 2015 10:37:32 +0000 (11:37 +0100)
committerDan van der Ster <daniel.vanderster@cern.ch>
Fri, 6 Mar 2015 10:37:32 +0000 (11:37 +0100)
Make the suppress-activate <device> feature work for activate-all
and activate-journal.

Signed-off-by: Dan van der Ster <daniel.vanderster@cern.ch>
src/ceph-disk

index c3c6951442093c0b530907c85ee7a1978bfd1d1c..73990cc6e5ffccdd7a85b0e690962dd347d28401 100755 (executable)
@@ -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):