From 53014bf437f0658b2b3389240c3dc7381da30890 Mon Sep 17 00:00:00 2001 From: Loic Dachary Date: Tue, 19 Jan 2016 16:43:42 +0700 Subject: [PATCH] ceph-disk: move check_journal_reqs (no change) To help with the prepare refactor. Signed-off-by: Loic Dachary --- src/ceph-disk/ceph_disk/main.py | 36 +++++++++++++++++---------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/src/ceph-disk/ceph_disk/main.py b/src/ceph-disk/ceph_disk/main.py index a6c52406f3b..bb907e64b44 100755 --- a/src/ceph-disk/ceph_disk/main.py +++ b/src/ceph-disk/ceph_disk/main.py @@ -1182,6 +1182,25 @@ def get_free_partition_index(dev): return 1 +def check_journal_reqs(args): + _, _, allows_journal = command([ + 'ceph-osd', '--check-allows-journal', + '-i', '0', + '--cluster', args.cluster, + ]) + _, _, wants_journal = command([ + 'ceph-osd', '--check-wants-journal', + '-i', '0', + '--cluster', args.cluster, + ]) + _, _, needs_journal = command([ + 'ceph-osd', '--check-needs-journal', + '-i', '0', + '--cluster', args.cluster, + ]) + return (not allows_journal, not wants_journal, not needs_journal) + + def update_partition(dev, description): """ Must be called after modifying a partition table so the kernel @@ -1689,23 +1708,6 @@ def prepare_dev( os.path.basename(rawdev)]) -def check_journal_reqs(args): - _, _, allows_journal = command([ - 'ceph-osd', '--check-allows-journal', - '-i', '0', - '--cluster', args.cluster, - ]) - _, _, wants_journal = command([ - 'ceph-osd', '--check-wants-journal', - '-i', '0', - '--cluster', args.cluster, - ]) - _, _, needs_journal = command([ - 'ceph-osd', '--check-needs-journal', - '-i', '0', - '--cluster', args.cluster, - ]) - return (not allows_journal, not wants_journal, not needs_journal) def main_prepare(args): -- 2.47.3