From: Alfredo Deza Date: Fri, 2 Aug 2013 16:45:36 +0000 (-0400) Subject: create a utility to verify the service location X-Git-Tag: v1.2~11^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=db6f20ca40443ce8ec59067d7b0bc712e21a21b7;p=ceph-deploy.git create a utility to verify the service location Signed-off-by: Alfredo Deza --- diff --git a/ceph_deploy/hosts/common.py b/ceph_deploy/hosts/common.py index 08ff9ca..d2028da 100644 --- a/ceph_deploy/hosts/common.py +++ b/ceph_deploy/hosts/common.py @@ -10,6 +10,18 @@ def ceph_version(conn, logger): return check_call(conn, logger, ['ceph', '--version']) +def which_service(conn, logger): + """ + Attempt to find the right `service` executable location as it + might not be in the path for the user executing the remote + calls + """ + locations = ['/sbin/service', '/usr/sbin/service'] + for location in locations: + if conn.modules.os.path.exists(location): + return location + + def mon_create(distro, logger, args, monitor_keyring, hostname): logger.debug('remote hostname: %s' % hostname) path = paths.mon.path(args.cluster, hostname)