Merge pull request #22015 from rallytime/bp-21947

Backport #21947 to 2014.7
This commit is contained in:
jfindlay 2015-03-25 15:59:09 -06:00
commit e9c9f9dc4b

View File

@ -51,11 +51,23 @@ def configtest():
salt '*' nginx.configtest
'''
ret = {}
cmd = '{0} -t'.format(__detect_os())
out = __salt__['cmd.run'](cmd).splitlines()
ret = out[0].split(': ')
return ret[-1]
out = __salt__['cmd.run_all'](cmd)
if out['retcode'] != 0:
ret['comment'] = 'Syntax Error'
ret['stderr'] = out['stderr']
ret['result'] = False
return ret
ret['comment'] = 'Syntax OK'
ret['stdout'] = out['stderr']
ret['result'] = True
return ret
def signal(signal=None):