mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Prevent crash during externally changed archive permissions
This commit is contained in:
parent
91b42578b2
commit
1970814111
1 changed files with 7 additions and 1 deletions
|
@ -909,7 +909,13 @@ def extracted(name,
|
|||
if extraction_needed:
|
||||
destination = os.path.join(name, contents['top_level_dirs'][0])
|
||||
if os.path.exists(destination):
|
||||
shutil.rmtree(destination)
|
||||
try:
|
||||
shutil.rmtree(destination)
|
||||
except OSError as err:
|
||||
ret['comment'] = 'Error removing destination directory ' \
|
||||
'"{0}": {1}'.format(destination, err)
|
||||
ret['result'] = False
|
||||
return ret
|
||||
|
||||
try:
|
||||
if_missing_path_exists = os.path.exists(if_missing)
|
||||
|
|
Loading…
Add table
Reference in a new issue