[Buildbot-commits] buildbot/buildbot/steps transfer.py,1.11,1.12

Brian Warner warner at users.sourceforge.net
Thu Mar 20 23:57:06 UTC 2008


Update of /cvsroot/buildbot/buildbot/buildbot/steps
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16120/buildbot/steps

Modified Files:
	transfer.py 
Log Message:
[project @ #115:Second-example-of-using-render-to-make-WithPropert.patch]
Patch by Greg Ward <gerg.ward+buildbot at gmail.com>:
Second example of using render() to make WithProperties easily available:
apply it to source/dest filenames in FileUpload and FileDownload steps.

Original author: dustin at v.igoro.us
Date: 2008-03-13 03:29:37+00:00

Index: transfer.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/steps/transfer.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- transfer.py	18 Jun 2007 02:52:49 -0000	1.11
+++ transfer.py	20 Mar 2008 23:57:04 -0000	1.12
@@ -4,7 +4,7 @@
 from twisted.internet import reactor
 from twisted.spread import pb
 from twisted.python import log
-from buildbot.process.buildstep import RemoteCommand, BuildStep
+from buildbot.process.buildstep import RemoteCommand, BuildStep, render
 from buildbot.process.buildstep import SUCCESS, FAILURE
 from buildbot.interfaces import BuildSlaveTooOldError
 
@@ -114,8 +114,8 @@
             m = "slave is too old, does not know about uploadFile"
             raise BuildSlaveTooOldError(m)
 
-        source = self.slavesrc
-        masterdest = self.masterdest
+        source = render(self.slavesrc, self.build)
+        masterdest = render(self.masterdest, self.build)
         # we rely upon the fact that the buildmaster runs chdir'ed into its
         # basedir to make sure that relative paths in masterdest are expanded
         # properly. TODO: maybe pass the master's basedir all the way down
@@ -128,7 +128,8 @@
         self.step_status.setText(['uploading', os.path.basename(source)])
 
         # we use maxsize to limit the amount of data on both sides
-        fileWriter = _FileWriter(self.masterdest, self.maxsize, self.mode)
+        # XXX should that be 'masterdest' or 'target'?
+        fileWriter = _FileWriter(masterdest, self.maxsize, self.mode)
 
         # default arguments
         args = {
@@ -243,8 +244,8 @@
 
         # we are currently in the buildmaster's basedir, so any non-absolute
         # paths will be interpreted relative to that
-        source = os.path.expanduser(self.mastersrc)
-        slavedest = self.slavedest
+        source = os.path.expanduser(render(self.mastersrc, self.build))
+        slavedest = render(self.slavedest, self.build)
         log.msg("FileDownload started, from master %r to slave %r" %
                 (source, slavedest))
 
@@ -267,7 +268,7 @@
 
         # default arguments
         args = {
-            'slavedest': self.slavedest,
+            'slavedest': slavedest,
             'maxsize': self.maxsize,
             'reader': fileReader,
             'blocksize': self.blocksize,





More information about the Commits mailing list