From: Sage Weil Date: Mon, 25 Nov 2019 23:30:31 +0000 (-0600) Subject: ceph-daemon: name mgr the same way mgr/ssh does X-Git-Tag: v15.1.0~679^2~3 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=3f2a5dbf27f0f588d1bf8b525506c15010f65cdc;p=ceph-ci.git ceph-daemon: name mgr the same way mgr/ssh does (with a random 6-char id, not the hostname) Signed-off-by: Sage Weil --- 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