Don't log command when output_loglevel == 'quiet'

This commit is contained in:
Erik Johnson 2018-04-04 14:57:45 -05:00
parent f59cee28db
commit cf28eb74aa
No known key found for this signature in database
GPG key ID: 5E5583C437808F3F

View file

@ -610,7 +610,7 @@ def _run(cmd,
ret['retcode'] = 1
return ret
if output_encoding is not None:
if output_loglevel != 'quiet' and output_encoding is not None:
log.debug('Decoding output from command %s using %s encoding',
cmd, output_encoding)
@ -626,10 +626,11 @@ def _run(cmd,
proc.stdout,
encoding=output_encoding,
errors='replace')
log.error(
'Failed to decode stdout from command %s, non-decodable '
'characters have been replaced', cmd
)
if output_loglevel != 'quiet':
log.error(
'Failed to decode stdout from command %s, non-decodable '
'characters have been replaced', cmd
)
try:
err = salt.utils.stringutils.to_unicode(
@ -643,10 +644,11 @@ def _run(cmd,
proc.stderr,
encoding=output_encoding,
errors='replace')
log.error(
'Failed to decode stderr from command %s, non-decodable '
'characters have been replaced', cmd
)
if output_loglevel != 'quiet':
log.error(
'Failed to decode stderr from command %s, non-decodable '
'characters have been replaced', cmd
)
if rstrip:
if out is not None: