Migrate apt_repository, group, and supervisorctl to use module.get_bin_path

This commit is contained in:
Stephen Fromm 2012-08-21 07:36:38 -07:00
parent 4c62e495eb
commit bdb39058ae
3 changed files with 12 additions and 18 deletions

View file

@ -21,12 +21,11 @@
import grp
def get_bin_path(module, arg):
if os.path.exists('/usr/sbin/%s' % arg):
return '/usr/sbin/%s' % arg
elif os.path.exists('/sbin/%s' % arg):
return '/sbin/%s' % arg
else:
bin = module.get_bin_path(arg)
if bin is None:
module.fail_json(msg="Cannot find %s" % arg)
else:
return bin
def group_del(module, group):
cmd = [get_bin_path(module, 'groupdel'), group]