Fix MacOSX Service Status Check and integration test

This commit is contained in:
Ch3LL 2018-01-03 17:19:51 -05:00
parent eba360870a
commit 74e6ed60ea
No known key found for this signature in database
GPG key ID: 132B55A7C13EFA73
2 changed files with 3 additions and 1 deletions

View file

@ -421,7 +421,7 @@ def status(name, sig=None, runas=None):
for line in output.splitlines():
if 'PID' in line:
continue
if re.search(name, line):
if re.search(name, line.split()[-1]):
if line.split()[0].isdigit():
if pids:
pids += '\n'

View file

@ -25,6 +25,8 @@ class ServiceModuleTest(ModuleCase):
elif os_family == 'Arch':
self.service_name = 'systemd-journald'
cmd_name = 'systemctl'
elif os_family == 'MacOS':
self.service_name = 'org.ntp.ntpd'
if salt.utils.which(cmd_name) is None:
self.skipTest('{0} is not installed'.format(cmd_name))