From: Joao Eduardo Luis Date: Thu, 31 Dec 2020 01:05:48 +0000 (+0000) Subject: cephadm: split mon prepare and create X-Git-Tag: v17.0.0~8^2~11 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1dd2dcc8ed98a6ffb7c23d059dc09ebc7229814c;p=ceph.git cephadm: split mon prepare and create Signed-off-by: Joao Eduardo Luis --- diff --git a/src/cephadm/cephadm b/src/cephadm/cephadm index 27897d4c1ab..f7f8bcb965b 100755 --- a/src/cephadm/cephadm +++ b/src/cephadm/cephadm @@ -3228,7 +3228,7 @@ def create_initial_monmap( return monmap -def create_mon( +def prepare_create_mon( ctx: CephadmContext, uid: int, gid: int, fsid: str, mon_id: str, @@ -3261,6 +3261,16 @@ def create_mon( return (mon_dir, log_dir) +def create_mon( + ctx: CephadmContext, + uid: int, gid: int, + fsid: str, mon_id: str +) -> None: + mon_c = get_container(ctx, fsid, 'mon', mon_id) + deploy_daemon(ctx, fsid, 'mon', mon_id, mon_c, uid, gid, + config=None, keyring=None) + + def wait_for_mon( ctx: CephadmContext, mon_id: str, mon_dir: str, @@ -3389,7 +3399,7 @@ def command_bootstrap(ctx): monmap = create_initial_monmap(ctx, uid, gid, fsid, mon_id, addr_arg) (mon_dir, log_dir) = \ - create_mon(ctx, uid, gid, fsid, mon_id, + prepare_create_mon(ctx, uid, gid, fsid, mon_id, bootstrap_keyring.name, monmap.name) with open(mon_dir + '/config', 'w') as f: @@ -3398,9 +3408,7 @@ def command_bootstrap(ctx): f.write(config) make_var_run(ctx, fsid, uid, gid) - mon_c = get_container(ctx, fsid, 'mon', mon_id) - deploy_daemon(ctx, fsid, 'mon', mon_id, mon_c, uid, gid, - config=None, keyring=None) + create_mon(ctx, uid, gid, fsid, mon_id) # config to issue various CLI commands tmp_config = write_tmp(config, uid, gid)