From 8c5bc71dbd94a863e129f606ca2978a2ddf55f7f Mon Sep 17 00:00:00 2001 From: Aneesh Agrawal Date: Mon, 3 Oct 2016 18:26:17 -0400 Subject: [PATCH] Propagate default workdir for newly created steps The StepsYAMLParsingStep is statically in the step list of the factory, so when starting a build Buildbot will call `setDefaultWorkdir` on each step. We need to save this value and propagate it to the steps we create on the fly to ensure they also receive a workdir value. --- buildbot/master/files/config/factories.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/buildbot/master/files/config/factories.py b/buildbot/master/files/config/factories.py index 5606aed7..d7bbddf5 100644 --- a/buildbot/master/files/config/factories.py +++ b/buildbot/master/files/config/factories.py @@ -167,6 +167,7 @@ class StepsYAMLParsingStep(buildstep.ShellMixin, buildstep.BuildStep): haltOnFailure = True flunkOnFailure = True + workdir = None def __init__(self, builder_name, environment, yaml_path, **kwargs): kwargs = self.setupShellMixin(kwargs) @@ -175,6 +176,10 @@ def __init__(self, builder_name, environment, yaml_path, **kwargs): self.environment = environment self.yaml_path = yaml_path + def setDefaultWorkdir(self, workdir): + buildstep.BuildStep.setDefaultWorkdir(self, workdir) + self.workdir = workdir + @defer.inlineCallbacks def run(self): self.is_windows = re.match('windows.*', self.builder_name) is not None