]> 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)
committerGuillaume Abrioux <gabrioux@redhat.com>
Wed, 30 Jan 2019 14:01:04 +0000 (15:01 +0100)
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 60df45edd6e6fcf99d4b0aef4b4d2895ea43d6ce..c3c7cd4180a28e48620d9bd9cab15dbba15e545a 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")