From 22024b23b8e2b58c195aa883d339dfa7520bf8d2 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 6 Jan 2022 12:38:15 -0500 Subject: [PATCH] Prefer shortname for collective When a colleective begins, default to using the shortname, even if gethostname returns a long one. --- confluent_server/confluent/collective/manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/confluent_server/confluent/collective/manager.py b/confluent_server/confluent/collective/manager.py index c25611bf..787aa79c 100644 --- a/confluent_server/confluent/collective/manager.py +++ b/confluent_server/confluent/collective/manager.py @@ -237,7 +237,7 @@ def get_myname(): mycachedname[1] = time.time() return mycachedname[0] except IOError: - myname = socket.gethostname() + myname = socket.gethostname().split('.')[0] with open('/etc/confluent/cfg/myname', 'w') as f: f.write(myname) mycachedname[0] = myname