From 0dd2364984c498c614affc4f3af0fbe40b9f632f Mon Sep 17 00:00:00 2001 From: Loic Dachary Date: Sun, 20 Sep 2015 14:34:47 +0200 Subject: [PATCH] ceph-disk: move update_partition from main_prepare to prepare_dev 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 --- src/ceph-disk | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/ceph-disk b/src/ceph-disk index 27040d18ec33e..c6a6955167081 100755 --- a/src/ceph-disk +++ b/src/ceph-disk @@ -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: -- 2.39.5