Skip to content

Commit

Permalink
handle ResourceGroup ScopeLocked error
Browse files Browse the repository at this point in the history
  • Loading branch information
tony-schndr committed Nov 14, 2024
1 parent 07deb79 commit 7154139
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ env
*/archive.tar.gz
tooling/bin
tooling/image-sync/config.yml
**/venv
**/__pycache__
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ portalocker==2.8.2
pycparser==2.21
PyJWT==2.8.0
pytest==7.4.4
requests==2.32.0
requests==2.32.3
six==1.16.0
tomli==2.0.1
typing_extensions==4.9.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@ def process_resource_group(resource_group: ResourceGroup, resource_client: Resou
result_poller = resource_client.resource_groups.begin_delete(resource_group_name)
print(f"result_poller of resource group deletion: {result_poller}")
except HttpResponseError as err:
target_error_code = "DenyAssignmentAuthorizationFailed"
if err.error.code == target_error_code:
print("skipping deletion of resource group due to deny assignment in the resource group")
else:
error_codes = ("DenyAssignmentAuthorizationFailed", "ScopeLocked")
if err.error.code in error_codes:
print(f"skipping deletion of resource group due to error code {err.error.code}")
else:
raise err


Expand Down

0 comments on commit 7154139

Please sign in to comment.