Skip to content

Commit

Permalink
fix bug in detecting leftover directories, test changing builddirs on…
Browse files Browse the repository at this point in the history
… existing builders
  • Loading branch information
Dustin J. Mitchell committed Aug 16, 2010
1 parent 3bd3592 commit b6f9d3a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion slave/buildslave/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ def remote_setBuilderList(self, wanted):
del(self.builders[name])

for d in os.listdir(self.basedir):
if os.path.isdir(d):
if os.path.isdir(os.path.join(self.basedir, d)):
if d not in wanted_dirs:
log.msg("I have a leftover directory '%s' that is not "
"being used by the buildmaster: you can delete "
Expand Down
3 changes: 2 additions & 1 deletion slave/buildslave/test/unit/test_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,13 @@ def check(builders):

def remove_my(_):
d = self.bot.callRemote("setBuilderList", [
('yourbld', 'yourblddir') ])
('yourbld', 'yourblddir2') ]) # note new builddir
def check(builders):
self.assertEqual(sorted(builders.keys()), sorted(['yourbld']))
# note that build dirs are not deleted..
self.assertTrue(os.path.exists(os.path.join(self.basedir, 'myblddir')))
self.assertTrue(os.path.exists(os.path.join(self.basedir, 'yourblddir')))
self.assertTrue(os.path.exists(os.path.join(self.basedir, 'yourblddir2')))
# 'your' should still be the same slavebuilder object
self.assertEqual(id(slavebuilders['your']), id(builders['yourbld']))
d.addCallback(check)
Expand Down

0 comments on commit b6f9d3a

Please sign in to comment.