Do not arbitrarily remove part dir. Add it to the path of dirs to delete

parent 13a73a1b
......@@ -300,9 +300,7 @@ class Script:
self._checkPromise('slapos_promise', self.options['location'])
except Exception:
if os.path.exists(self.options['location']):
self.logger.info('Removing location %r because of error' %
self.options['location'])
shutil.rmtree(self.options['location'])
self.cleanup_dir_list.append(self.options['location'])
raise
finally:
for d in self.cleanup_dir_list:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment