From: Gary Lowell Date: Tue, 19 Mar 2013 06:01:37 +0000 (-0700) Subject: mon.py: Use short hostname. X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ff05e605182a8378798d4cf82eb54a8a451270ca;p=ceph-deploy.git mon.py: Use short hostname. Depending on the system configuration, gethostname can return either a short name or the fqdn. Trim the return from socket.gethostname() to just the hostname. Signed-off-by: Gary Lowell --- diff --git a/ceph_deploy/mon.py b/ceph_deploy/mon.py index 6ca11d8..d0e020b 100644 --- a/ceph_deploy/mon.py +++ b/ceph_deploy/mon.py @@ -18,7 +18,7 @@ def create_mon(cluster, monitor_keyring, init): import socket import subprocess - hostname = socket.gethostname() + hostname = socket.gethostname().split('.')[0] path = '/var/lib/ceph/mon/ceph-{hostname}'.format( hostname=hostname, ) @@ -152,7 +152,7 @@ def destroy_mon(cluster): import subprocess import socket - hostname = socket.gethostname() + hostname = socket.gethostname().split('.')[0] path = '/var/lib/ceph/mon/ceph-{hostname}'.format( hostname=hostname, )