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 <gary.lowell@inktank.com>
import socket
import subprocess
- hostname = socket.gethostname()
+ hostname = socket.gethostname().split('.')[0]
path = '/var/lib/ceph/mon/ceph-{hostname}'.format(
hostname=hostname,
)
import subprocess
import socket
- hostname = socket.gethostname()
+ hostname = socket.gethostname().split('.')[0]
path = '/var/lib/ceph/mon/ceph-{hostname}'.format(
hostname=hostname,
)