If path already exist at beginning of installation, add it to cleanup list and raise.

parent 71b6247a
......@@ -295,6 +295,10 @@ class Script:
def install(self):
try:
env = self.getEnvironment()
if os.path.exists(self.options['location']):
self.cleanup_dir_list.append(self.options['location'])
raise shutil.Error('Directory %s already exists' %
self.options['location'])
exec self.options['script']
try:
self._checkPromise('slapos_promise', self.options['location'])
......
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