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 12, 2024
1 parent 07deb79 commit 3ce16ce
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 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,11 @@ 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:
if err.error.code == "DenyAssignmentAuthorizationFailed":
print("skipping deletion of resource group due to deny assignment in the resource group")
else:
elif err.error.code == "ScopeLocked":
print("cannot perform delete operation, the resource group is locked")
else:
raise err


Expand Down

0 comments on commit 3ce16ce

Please sign in to comment.