Project

General

Profile

Bug #5911 » debian-mon-create.py-1.patch

Really handle the possibility of additional init types - Mark Kirkwood, 08/09/2013 11:42 PM

View differences:

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)
(3-3/4)