Ticket #126 (closed defect: fixed)
ShellCommand: 'env' doesn't work in 0.7.6 (because remote_kwargs not stored in factory)
| Reported by: | gward | Owned by: | warner |
|---|---|---|---|
| Priority: | major | Milestone: | 0.7.7 |
| Version: | 0.7.6 | Keywords: | |
| Cc: |
Description
If you use the new 0.7.6 style of passing a whole BuildStep object to factory.addStep(), many attributes of ShellCommand do not work, e.g. 'env'. Example:
factory.addStep(ShellCommand(command=[...], description="...", env={...})
In this case, the environment variables specified in 'env' are not actually used when the BuildStep runs. This is because 'env' (and many other of the kwargs passed to ShellCommand()) is not stored in the step's factory tuple, so is not included in future clones of this ShellCommand object.
I have hacked around this by subclassing BuildFactory and adding this to MyBuildFactory.addStep():
if isinstance(step, shell.ShellCommand):
step.addFactoryArguments(**step.remote_kwargs)
I *suspect* this patch will fix it, but have not tested it:
--- buildbot/steps/shell.py.orig 2007-09-30 22:48:39.000000000 -0400
+++ buildbot/steps/shell.py 2007-10-24 16:45:32.285303148 -0400
@@ -111,7 +111,8 @@
self.addFactoryArguments(workdir=workdir,
description=description,
descriptionDone=descriptionDone,
- command=command)
+ command=command,
+ **kwargs)
# everything left over goes to the RemoteShellCommand
kwargs['workdir'] = workdir # including a copy of 'workdir'
Change History
Note: See
TracTickets for help on using
tickets.
![[Buildbot Logo]](/trac/chrome/site/header-text-transparent.png)