mirror of
https://github.com/ceph/ceph
synced 2024-12-19 01:46:00 +00:00
Merge pull request #3892 from cernceph/cephdisk
ceph-disk: activate-[all|journal] should suppress Backport: hammer, giant, firefly Reviewed-by: Sage Weil <sage@redhat.com>
This commit is contained in:
commit
1ad2f3b477
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user