[Buildbot-devel] WithProperties question

Amber Yust ayust at yelp.com
Wed May 25 19:59:21 UTC 2011


WithProperties is a wrapper that is not designed to be evaluated until
build-time. It doesn't act like a string in buildsteps; the command= arg et
cetera are just smart enough to go through and handle WithProperties
correctly.

If you want to concatenate strings at import or run-time (rather than
build-time), you need to do it before adding the WithProperties wrapper.

~Amber

On Wed, May 25, 2011 at 12:46 PM, Matthew Morse <matt at apple.com> wrote:

> Hi,
>
> I clearly don't understand something fundamental about WithProperties, but
> I haven't been able to find an answer in the doc. Here's the issue:
>
> When I used WithProperties within the context of a build step or shell
> command, it does what I'd expect, for example:
>
>
>
> -----------------------------------------------------------------------------------------------------------------
>
> output_library_dir_buildstamp = WithProperties("%s-%d", "buildername",
> "buildnumber")
>
>
> set_library_name = shell.ShellCommand(
>         description = "Renaming library",
>         descriptionDone=["Finished","renaming library"],
>         command = ["mv", "library", output_library_dir_buildstamp],
>         workdir = output_library_dir,
>         haltOnFailure=True,
>    )
>
>
> ---> I get an output name of the form "someBuilderName-num".
>
> -----------------------------------------------------------------------------------------------------------------
>
> But, if I want to take the value of 'output_library_dir_buildstamp' and
> concat some string (in this case, for the tar file name), I get an error:
>
> output_library_dir_buildstamp = WithProperties("%s-%d", "buildername",
> "buildnumber")
> tar_file_name = output_library_dir_buildstamp + ".tar"
>
> --> TypeError: unsupported operand type(s) for +: 'instance' and 'str'
>
>
> Why does the return value of WithProperties act like a string in the
> ShellCommand, but can't be used as such elsewhere?
>
> And, how do I convert it to a string for concatenation, etc. when it isn't
> used within a build step?
>
> Thanks,
> -- Matt
>
>
>
> ------------------------------------------------------------------------------
> vRanger cuts backup time in half-while increasing security.
> With the market-leading solution for virtual backup and recovery,
> you get blazing-fast, flexible, and affordable data protection.
> Download your free trial now.
> http://p.sf.net/sfu/quest-d2dcopy1
> _______________________________________________
> Buildbot-devel mailing list
> Buildbot-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/buildbot-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://buildbot.net/pipermail/devel/attachments/20110525/291ac102/attachment.html>


More information about the devel mailing list