From: Joao Eduardo Luis Date: Thu, 31 Dec 2020 01:05:48 +0000 (+0000) Subject: cephadm: split mon prepare and create X-Git-Tag: v16.2.0~232^2~28 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=00f56225a502472a5704d3f604cca95b8f41da91;p=ceph.git cephadm: split mon prepare and create Signed-off-by: Joao Eduardo Luis (cherry picked from commit 1dd2dcc8ed98a6ffb7c23d059dc09ebc7229814c) --- diff --git a/src/cephadm/cephadm b/src/cephadm/cephadm index b2a8e8ef840..d885b752afe 100755 --- a/src/cephadm/cephadm +++ b/src/cephadm/cephadm @@ -3231,7 +3231,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, @@ -3264,6 +3264,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, @@ -3392,7 +3402,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: @@ -3401,9 +3411,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)