From: Loic Dachary Date: Tue, 19 Jan 2016 09:43:42 +0000 (+0700) Subject: ceph-disk: move check_journal_reqs (no change) X-Git-Tag: v10.0.4~46^2~13 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=53014bf437f0658b2b3389240c3dc7381da30890;p=ceph.git ceph-disk: move check_journal_reqs (no change) To help with the prepare refactor. Signed-off-by: Loic Dachary --- diff --git a/src/ceph-disk/ceph_disk/main.py b/src/ceph-disk/ceph_disk/main.py index a6c52406f3b6..bb907e64b44c 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):