From: Loic Dachary Date: Sun, 20 Sep 2015 12:34:47 +0000 (+0200) Subject: ceph-disk: move update_partition from main_prepare to prepare_dev X-Git-Tag: v9.1.0~89^2^2~10 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0dd2364984c498c614affc4f3af0fbe40b9f632f;p=ceph.git 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 --- diff --git a/src/ceph-disk b/src/ceph-disk index 27040d18ec33..c6a695516708 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: