]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-disk: move check_journal_reqs (no change)
authorLoic Dachary <ldachary@redhat.com>
Tue, 19 Jan 2016 09:43:42 +0000 (16:43 +0700)
committerLoic Dachary <ldachary@redhat.com>
Thu, 4 Feb 2016 07:38:08 +0000 (14:38 +0700)
To help with the prepare refactor.

Signed-off-by: Loic Dachary <loic@dachary.org>
src/ceph-disk/ceph_disk/main.py

index a6c52406f3b6a07bbf650e05c2b9795f2daed2b2..bb907e64b44c4661f84a82107948b9b34d903265 100755 (executable)
@@ -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):