From 3f2a5dbf27f0f588d1bf8b525506c15010f65cdc Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 25 Nov 2019 17:30:31 -0600 Subject: [PATCH] ceph-daemon: name mgr the same way mgr/ssh does (with a random 6-char id, not the hostname) Signed-off-by: Sage Weil --- src/ceph-daemon/ceph-daemon | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ceph-daemon/ceph-daemon b/src/ceph-daemon/ceph-daemon index 7bb33f5230d..597d4032200 100755 --- a/src/ceph-daemon/ceph-daemon +++ b/src/ceph-daemon/ceph-daemon @@ -194,6 +194,11 @@ def get_fqdn(): # type: () -> str return socket.getfqdn() or socket.gethostname() +def generate_service_id(): + # type: () -> str + return ''.join(random.choice(string.ascii_lowercase) + for _ in range(6)) + def generate_password(): # type: () -> str return ''.join(random.choice(string.ascii_lowercase + string.digits) @@ -926,7 +931,7 @@ def command_bootstrap(): fsid = args.fsid or make_fsid() hostname = get_hostname() mon_id = args.mon_id or hostname - mgr_id = args.mgr_id or hostname + mgr_id = args.mgr_id or generate_service_id() logging.info('Cluster fsid: %s' % fsid) # config -- 2.39.5