Reduce salt-ssh debug log verbosity

Anything that involves the SHIM should be logged to TRACE
This commit is contained in:
Colton Myers 2015-05-01 13:08:49 -06:00
parent 83ef7cb114
commit 9b9c30f5ad
2 changed files with 11 additions and 2 deletions

View File

@ -285,7 +285,11 @@ class Shell(object):
logmsg = 'Executing command: {0}'.format(cmd)
if self.passwd:
logmsg = logmsg.replace(self.passwd, ('*' * 6))
log.debug(logmsg)
if 'decode("base64")' in logmsg:
log.debug('Executed SHIM command. Command logged to TRACE')
log.trace(logmsg)
else:
log.debug(logmsg)
ret = self._run_cmd(cmd)
return ret

View File

@ -216,7 +216,12 @@ class Terminal(object):
'Child Forked! PID: {0} STDOUT_FD: {1} STDERR_FD: '
'{2}'.format(self.pid, self.child_fd, self.child_fde)
)
log.debug('Terminal Command: {0}'.format(' '.join(self.args)))
terminal_command = ' '.join(self.args)
if 'decode("base64")' in terminal_command:
log.debug('VT: Salt-SSH SHIM Terminal Command executed. Logged to TRACE')
log.trace('Terminal Command: {0}'.format(terminal_command))
else:
log.debug('Terminal Command: {0}'.format(terminal_command))
# <---- Spawn our terminal -------------------------------------------
# ----- Setup Logging ----------------------------------------------->