Skip to content

Commit

Permalink
Add logEnviron flag to MasterShellCommand
Browse files Browse the repository at this point in the history
Added the logEnviron flag to the MasterShellCommand
step. The master may have variables in it's environment
(such as AWS credentials) which we do not want to leak
into a log.

Signed-off-by: Giuseppe Di Natale <dinatale2@llnl.gov>
  • Loading branch information
dinatale2 committed Sep 22, 2016
1 parent 122f7da commit adc172c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion master/buildbot/steps/master.py
Expand Up @@ -50,6 +50,7 @@ def __init__(self, command, **kwargs):
self.env = kwargs.pop('env', None)
self.usePTY = kwargs.pop('usePTY', 0)
self.interruptSignal = kwargs.pop('interruptSignal', 'KILL')
self.logEnviron = kwargs.pop('logEnviron', True)

BuildStep.__init__(self, **kwargs)

Expand Down Expand Up @@ -139,7 +140,9 @@ def subst(match):
"lists; key '%s' is incorrect" % (key,))
newenv[key] = p.sub(subst, env[key])
env = newenv
stdio_log.addHeader(" env: %r\n" % (env,))

if self.logEnviron:
stdio_log.addHeader(" env: %r\n" % (env,))

# TODO add a timeout?
self.process = reactor.spawnProcess(self.LocalPP(self), argv[0], argv,
Expand Down

0 comments on commit adc172c

Please sign in to comment.