From adc172c9ae20ffb624a87a033cbf939d1beba9a0 Mon Sep 17 00:00:00 2001 From: Giuseppe Di Natale Date: Thu, 22 Sep 2016 15:27:09 -0700 Subject: [PATCH] Add logEnviron flag to MasterShellCommand 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 --- master/buildbot/steps/master.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/master/buildbot/steps/master.py b/master/buildbot/steps/master.py index 338293a155f..cf7f0aa1a59 100644 --- a/master/buildbot/steps/master.py +++ b/master/buildbot/steps/master.py @@ -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) @@ -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,