]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-daemon: name mgr the same way mgr/ssh does
authorSage Weil <sage@redhat.com>
Mon, 25 Nov 2019 23:30:31 +0000 (17:30 -0600)
committerSage Weil <sage@redhat.com>
Mon, 2 Dec 2019 23:47:50 +0000 (17:47 -0600)
(with a random 6-char id, not the hostname)

Signed-off-by: Sage Weil <sage@redhat.com>
src/ceph-daemon/ceph-daemon

index 7bb33f5230db6b6dffc29abebe29d62b82749687..597d40322009e2f4da1b671df933e596c38435ae 100755 (executable)
@@ -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