Skip to content

Commit

Permalink
[ARM] az bicep: fix installation check for concurrent usages
Browse files Browse the repository at this point in the history
If `az` is called by multiple processes or threads the code has a race
condition. By simply allowing for the directory to exist, the same
behavior as before is achieved without failing in concurrent usages.
  • Loading branch information
marlamb committed Jan 27, 2025
1 parent ac6f490 commit 4c8d3b3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/azure-cli/azure/cli/command_modules/resource/_bicep.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,7 @@ def ensure_bicep_installation(cli_ctx, release_tag=None, target_platform=None, s
return

installation_dir = os.path.dirname(installation_path)
if not os.path.exists(installation_dir):
os.makedirs(installation_dir)
os.makedirs(installation_dir, exist_ok=True)

try:
release_tag = release_tag if release_tag else get_bicep_latest_release_tag()
Expand Down

0 comments on commit 4c8d3b3

Please sign in to comment.