Ticket #602 (closed enhancement: fixed)
Exception in buildslave setBuilddir (bot.py) 'No such file or directory'
| Reported by: | fabrice | Owned by: | |
|---|---|---|---|
| Priority: | minor | Milestone: | 0.7.12 |
| Version: | 0.7.11 | Keywords: | |
| Cc: |
Description
This exception occurs because /home/bbot1/builds exists but subdir 'products' does not. Thus, in buildbot/slave/bot.py: setBuilddir(), os.mkdir, raises an exception when trying to create basedir '/home/bbot1/builds/products/p1-buildbot-test':
2009-07-29 10:41:36+0200 [Broker,client] Unhandled Error Traceback (most recent call last): File "/usr/lib/python2.5/site-packages/twisted/spread/banana.py", line 146, in gotItem self.callExpressionReceived(item) File "/usr/lib/python2.5/site-packages/twisted/spread/banana.py", line 111, in callExpressionReceived self.expressionReceived(obj) File "/usr/lib/python2.5/site-packages/twisted/spread/pb.py", line 526, in expressionReceived method(*sexp[1:]) File "/usr/lib/python2.5/site-packages/twisted/spread/pb.py", line 837, in proto_message self._recvMessage(self.localObjectForID, requestID, objectID, message, answerRequired, netArgs, netKw) --- <exception caught here> --- File "/usr/lib/python2.5/site-packages/twisted/spread/pb.py", line 851, in _recvMessage netResult = object.remoteMessageReceived(self, message, netArgs, netKw) File "/usr/lib/python2.5/site-packages/twisted/spread/flavors.py", line 117, in remoteMessageReceived state = method(*args, **kw) File "/usr/lib/python2.5/site-packages/buildbot/slave/bot.py", line 304, in remote_setBuilderList b.setBuilddir(builddir) File "/usr/lib/python2.5/site-packages/buildbot/slave/bot.py", line 89, in setBuilddir os.mkdir(self.basedir) exceptions.OSError: [Errno 2] No such file or directory: '/home/bbot1/builds/products/p1-buildbot-test'
Instead of os.mkdir, maybe it would be better to use 'os.makedirs':
import os, errno
#...
try:
os.makedirs(self.basedir)
except os.error, e:
if e.errno != errno.EEXIST:
raise
This will create the full buildslave base directory and catch silently the exception when the leaf directory already exists. Any other errors will be raised to the caller.
Change History
Note: See
TracTickets for help on using
tickets.
![[Buildbot Logo]](/chrome/site/header-text-transparent.png)
Good point - thanks!