mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
Merge pull request #22015 from rallytime/bp-21947
Backport #21947 to 2014.7
This commit is contained in:
commit
e9c9f9dc4b
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user