Don't set detailed-exitcodes when noop
Change-Id: I3819ad5920a0a88b0b52ecb9b77a58c6d588fbdc
This commit is contained in:
parent
fccf47a713
commit
e8632f41a4
@ -193,13 +193,13 @@ def main():
|
|||||||
if not p['manifest']:
|
if not p['manifest']:
|
||||||
cmd = ("%(base_cmd)s agent --onetime"
|
cmd = ("%(base_cmd)s agent --onetime"
|
||||||
" --ignorecache --no-daemonize --no-usecacheonfailure"
|
" --ignorecache --no-daemonize --no-usecacheonfailure"
|
||||||
" --no-splay --detailed-exitcodes --verbose") % dict(
|
" --no-splay --verbose") % dict(
|
||||||
base_cmd=base_cmd,
|
base_cmd=base_cmd,
|
||||||
)
|
)
|
||||||
if p['puppetmaster']:
|
if p['puppetmaster']:
|
||||||
cmd += " --server %s" % pipes.quote(p['puppetmaster'])
|
cmd += " --server %s" % pipes.quote(p['puppetmaster'])
|
||||||
else:
|
else:
|
||||||
cmd = "%s apply --detailed-exitcodes " % base_cmd
|
cmd = "%s apply " % base_cmd
|
||||||
cmd += pipes.quote(p['manifest'])
|
cmd += pipes.quote(p['manifest'])
|
||||||
if p['logdest'] != 'stdout':
|
if p['logdest'] != 'stdout':
|
||||||
cmd += " --logdest %s" % p['logdest']
|
cmd += " --logdest %s" % p['logdest']
|
||||||
@ -208,9 +208,12 @@ def main():
|
|||||||
if p['environment']:
|
if p['environment']:
|
||||||
cmd += " --environment '%s'" % p['environment']
|
cmd += " --environment '%s'" % p['environment']
|
||||||
if module.check_mode or p['noop']:
|
if module.check_mode or p['noop']:
|
||||||
|
# Noop causes detailed-exitcodes to sometimes erroneously
|
||||||
|
# return failures, so we only set detailed-exitcodes when
|
||||||
|
# running for real.
|
||||||
cmd += " --noop"
|
cmd += " --noop"
|
||||||
else:
|
else:
|
||||||
cmd += " --no-noop"
|
cmd += " --no-noop --detailed-exitcodes"
|
||||||
if p['debug']:
|
if p['debug']:
|
||||||
cmd += " --debug"
|
cmd += " --debug"
|
||||||
rc, stdout, stderr = module.run_command(cmd)
|
rc, stdout, stderr = module.run_command(cmd)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user