]> git.apps.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>
Mon, 28 Jan 2019 09:00:35 +0000 (09:00 +0000)
socket.gethostname may return a FQDN. Problem found in Linode.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
library/ceph_key.py

index 41287c93e98e7b00d8bfd7548b2591755846cbcf..bc49ae2b412ebc7afe76fdf51cbd7d3433fce96d 100644 (file)
@@ -643,7 +643,7 @@ def run_module():
             module, list_keys(cluster, user, user_key, container_image))
 
     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")