]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
use shortname in keyring path
authorPatrick Donnelly <pdonnell@redhat.com>
Sat, 26 Jan 2019 02:48:28 +0000 (18:48 -0800)
committermergify[bot] <mergify[bot]@users.noreply.github.com>
Thu, 31 Jan 2019 00:56:29 +0000 (00:56 +0000)
socket.gethostname may return a FQDN. Problem found in Linode.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
(cherry picked from commit 8cd0308f5f570635d66295c442ea49dc2c043194)

library/ceph_key.py

index 9a77afa46d2365652779dcb4b67c42f926a2a1a4..a5fd517c917a7a83b39f8b5636e046095eff6998 100644 (file)
@@ -612,7 +612,7 @@ def run_module():
             module, list_keys(cluster, user, user_key, containerized))
 
     elif state == "fetch_initial_keys":
-        hostname = socket.gethostname()
+        hostname = socket.gethostname().split('.', 1)[0]
         user = "mon."
         user_key = os.path.join(
             "/var/lib/ceph/mon/" + cluster + "-" + hostname + "/keyring")