Skip to content

Instantly share code, notes, and snippets.

@tomprince
Created December 9, 2010 18:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomprince/735075 to your computer and use it in GitHub Desktop.
Save tomprince/735075 to your computer and use it in GitHub Desktop.
diff --git a/slave/buildslave/commands/fs.py b/slave/buildslave/commands/fs.py
index 730c4b1..1d5fddb 100644
--- a/slave/buildslave/commands/fs.py
+++ b/slave/buildslave/commands/fs.py
@@ -66,8 +66,12 @@ class RemoveDirectory(base.Command):
if runtime.platformType != "posix":
# if we're running on w32, use rmtree instead. It will block,
# but hopefully it won't take too long.
- utils.rmdirRecursive(self.dir)
- return defer.succeed(0)
+ try:
+ utils.rmdirRecursive(self.dir)
+ self.sendStatus({'rc': 0})
+ except:
+ self.sendStatus({'rc': 1})
+ return
d = self._clobber(None)
d.addCallback(self._sendRC)
@@ -166,10 +170,8 @@ class CopyDirectory(base.Command):
command = ['cp', '-R', '-P', '-p', fromdir, todir]
c = runprocess.RunProcess(self.builder, command, self.builder.basedir,
- sendRC=False, timeout=self.timeout, maxTime=self.maxTime,
+ timeout=self.timeout, maxTime=self.maxTime,
usePTY=False)
self.command = c
d = c.start()
- d.addCallback(self._abandonOnFailure)
- d.addCallback(self._sendRC)
return d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment