]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-disk: move update_partition from main_prepare to prepare_dev
authorLoic Dachary <ldachary@redhat.com>
Sun, 20 Sep 2015 12:34:47 +0000 (14:34 +0200)
committerLoic Dachary <ldachary@redhat.com>
Tue, 22 Sep 2015 06:46:56 +0000 (08:46 +0200)
The update_partition call in main_prepare happens immediately after
prepare_dev but only if the data argument is a block device. There is no
reason for this separation: it is more sensible to call it from within
prepare_dev.

There is an additional test in prepare_dev that verifies partprobe won't
be called on a partition because it would not make sense.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
src/ceph-disk

index 27040d18ec33edf04bab089c6a4e356ef13c7e1e..c6a695516708196c6c49424d3dd7b89d751cddbc 100755 (executable)
@@ -1666,6 +1666,7 @@ def prepare_dev(
             )
         except subprocess.CalledProcessError as e:
             raise Error(e)
+        update_partition(data, 'prepared')
 
 def check_journal_reqs(args):
     _, allows_journal = command([
@@ -1893,9 +1894,6 @@ def main_prepare(args):
             raise Error('not a dir or block device', args.data)
         prepare_lock.release()  # noqa
 
-        if stat.S_ISBLK(dmode):
-            update_partition(args.data, 'prepared')
-
     except Error as e:
         if journal_dm_keypath:
             try: