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

parent 13a73a1b
...@@ -300,9 +300,7 @@ class Script: ...@@ -300,9 +300,7 @@ class Script:
self._checkPromise('slapos_promise', self.options['location']) self._checkPromise('slapos_promise', self.options['location'])
except Exception: except Exception:
if os.path.exists(self.options['location']): if os.path.exists(self.options['location']):
self.logger.info('Removing location %r because of error' % self.cleanup_dir_list.append(self.options['location'])
self.options['location'])
shutil.rmtree(self.options['location'])
raise raise
finally: finally:
for d in self.cleanup_dir_list: 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