[Buildbot-devel] work-dir with shell.WithProperties?

A.T.Hofkamp a.t.hofkamp at tue.nl
Wed Jun 6 12:26:45 UTC 2007


Axel Hecht wrote:
> You likely need both parts of my internal patch goodness. The first
> actually ensures that you the working dir exists on your slave, the
> second one adding support for WithProperties  to ShellCommand's
> workdir.

Thank you for the patch.

> Index: buildbot/slave/commands.py
> --- buildbot/slave/commands.py
> +++ buildbot/slave/commands.py
> @@ -300,6 +300,9 @@
>         return self.deferred
> 
>     def _startCommand(self):
> +        # ensure workdir
> +        if not os.path.isdir(self.workdir):
> +            os.makedirs(self.workdir)
>         log.msg("ShellCommand._startCommand")
>         if self.notreally:
>             self.sendStatus({'header': "command '%s' in dir %s" % \

I didn't include this patch since the directory should just have been created 
in the previous step by a tar xzf command.

> Index: buildbot/steps/shell.py
> --- buildbot/steps/shell.py
> +++ buildbot/steps/shell.py
> @@ -206,6 +206,8 @@
>         assert isinstance(command, (list, tuple, str))
>         # create the actual RemoteShellCommand instance now
>         kwargs = self.remote_kwargs
> +        if isinstance(kwargs['workdir'], WithProperties):
> +            kwargs['workdir'] = kwargs['workdir'].render(self.build)
>         kwargs['command'] = command
>         kwargs['logfiles'] = self.logfiles
>         cmd = RemoteShellCommand(**kwargs)

This patch was exactly what I needed.
Thanks!!

(worthwhile for inclusion in the next release imho)

Albert




More information about the devel mailing list