1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-12-25 17:36:13 +01:00

Merge pull request #1301 from marxin/fix-old-folder

clean-up .old folder if an exception happens
This commit is contained in:
Daniel Mach 2023-04-17 14:22:38 +02:00 committed by GitHub
commit e299ab98bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -444,8 +444,10 @@ class Serviceinfo:
msg = f'"{old_dir}" exists, please remove it'
raise oscerr.OscIOError(None, msg)
result = self._execute(dir, old_dir, callmode, singleservice, verbose)
shutil.rmtree(old_dir)
try:
result = self._execute(dir, old_dir, callmode, singleservice, verbose)
finally:
shutil.rmtree(old_dir)
return result
def _execute(