Skip to content

Commit

Permalink
{Core} Ignore FileNotFoundError in rmtree_with_retry (Azure#21969)
Browse files Browse the repository at this point in the history
  • Loading branch information
jiasli authored Apr 8, 2022
1 parent 9c045b5 commit 061c1ee
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/azure-cli-core/azure/cli/core/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -1279,6 +1279,10 @@ def rmtree_with_retry(path):
import shutil
shutil.rmtree(path)
return
except FileNotFoundError:
# The folder has already been deleted. No further retry is needed.
# errno: 2, winerror: 3, strerror: 'The system cannot find the path specified'
return
except OSError as err:
if retry_num > 0:
logger.warning("Failed to delete '%s': %s. Retrying ...", path, err)
Expand Down

0 comments on commit 061c1ee

Please sign in to comment.