# HG changeset patch # User osimons # Date 1247435483 0 # Node ID c66190747a9ccd6c9d56185c06ea037bd25d60a4 # Parent 4ddf60f40a1f05af259cc1b043461778eb04cf39 0.6dev: In the event that loading Recipe fails, `basedir` would not yet have been defined, and removing it would fail. diff --git a/bitten/slave.py b/bitten/slave.py --- a/bitten/slave.py +++ b/bitten/slave.py @@ -253,6 +253,7 @@ def _execute_build(self, build_url, fileobj): build_id = build_url and int(build_url.split('/')[-1]) or 0 xml = xmlio.parse(fileobj) + basedir = '' try: recipe = Recipe(xml, os.path.join(self.work_dir, self.build_dir), self.config) @@ -271,7 +272,7 @@ if self.dry_run: self._cancel_build(build_url) finally: - if not self.keep_files: + if not self.keep_files and os.path.isdir(basedir): log.debug('Removing build directory %s' % basedir) _rmtree(basedir) if self.single_build: