[Buildbot-devel] FileUpload to distinct directory on master

Greg Ward gerg.ward+buildbot at gmail.com
Thu Aug 28 17:05:08 UTC 2008


On 26 August 2008, Jimmy John said:
>    I made a modification to the __init__.py method present in the buildbot/steps/transfer.py script to get the FileUpload to create directories recursively if the path leading up to the file does not exist on the master. I have tested this and it works on Linux.
> 
> Here is the change:
> 
> def __init__(self, destfile, maxsize, mode):
> 
>         #if the directory leading to the file does not exist, create them recursively
>         dirname = os.path.dirname(destfile)
>         if not os.path.isdir(dirname):
>            os.makedirs(dirname)
> 
>         self.destfile = destfile
>         self.fp = open(destfile, "wb")
>         if mode is not None:
>             os.chmod(destfile, mode)
>         self.remaining = maxsize

That's not a change, it's a chunk of code.  It would be much easier to
review and understand your change if you provided a patch -- e.g. run
"diff -u <oldfile> <newfile>" and send the output.

> The above works for my needs. I tried creating a tkt but I don't seem
> to have sufficient privileges. Let me know if you think the above
> patch works in the twisted context and i'll send you the file...

I just created ticket #341 for you.  I will adapt your patch and attach
it to the ticket now.

Anyways, the ticket is here: http://buildbot.net/trac/ticket/341

And my attached patch: http://buildbot.net/trac/attachment/ticket/341/buildbot-ticket-341.patch?format=raw

        Greg




More information about the devel mailing list