[users at bb.net] Interpolate a property with embedded property
David Weidenkopf
dweidenkopf at cococorp.com
Tue Oct 18 04:41:12 UTC 2016
Hello all,
I am using 0.9 on both master and worker. Is there a way to force an
Interpolate from a renderable?
I have a property that contains a property format string that I
want
interpolated as part of the render execution.
I have tried Interpolating within the renderable but I get the following
error:
Unpersistable('Unpersistable data: instance of class
buildbot.process.properties.Interpolate deemed insecure')
I am guessing that is because the result is an object, not the string I am
trying to render.
In the below code, self.outputs is a dictionary where the value has a
string with a property formatted string in it like this:
outputs={ 'ar71xx' : os.path.join('ar71xx', 'pkg',
'minder-full_%(prop:version)s.%(prop:buildtag)s_ar71xx.ipk')}
Here is my command renderable
class CopyOutputCommand(object):
implements(IRenderable)
def getRenderingFor(self, props):
arch = props.getProperty('arch')
output_dir = props.getProperty('output_dir')
version = props.getProperty('version')
buildtag = props.getProperty('buildtag')
#src = os.path.join(output_dir, 'packages', 'coco',
os.path.basename(self.outputs[arch]))
src = util.Interpolate(os.path.join(output_dir, 'packages', 'coco',
os.path.basename(self.outputs[arch])))
dst = os.path.join(output_dir, '{0}.{1}-sdk'.format(version, buildtag),
arch, 'pkg')
return ['cp', src, dst]
def __init__(self, outputs):
self.outputs = outputs
Thanks for any advice
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.buildbot.net/pipermail/users/attachments/20161017/f191f4d1/attachment.html>
More information about the users
mailing list