Bug #5911 » debian-mon-create.py-1.patch
ceph_deploy/hosts/debian/mon/create.py | ||
---|---|---|
from ceph_deploy.util.wrappers import check_call
|
||
from ceph_deploy.hosts import common
|
||
from ceph_deploy import lsb
|
||
def create(distro, logger, args, monitor_keyring):
|
||
hostname = distro.sudo_conn.modules.socket.gethostname().split('.')[0]
|
||
common.mon_create(distro, logger, args, monitor_keyring, hostname)
|
||
init = lsb.choose_init(distro.name, distro.codename)
|
||
if distro.name.lower() == 'ubuntu':
|
||
if init == 'upstart': # Ubuntu uses upstart
|
||
check_call(
|
||
distro.sudo_conn,
|
||
logger,
|
||
... | ... | |
],
|
||
)
|
||
else: # Debian doesn't use initctl
|
||
elif init == 'sysvinit': # Debian uses sysvinit
|
||
service = common.which_service(distro.sudo_conn, logger)
|
||
check_call(
|
||
... | ... | |
'mon.{hostname}'.format(hostname=hostname)
|
||
],
|
||
)
|
||
else:
|
||
raise RuntimeError('create cannot use init %s' % init)
|