Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,13 @@


def _get_resource_group_by_name(cli_ctx, resource_group_name):
from msrestazure.azure_exceptions import CloudError
try:
resource_client = resource_client_factory(cli_ctx).resource_groups
return resource_client.get(resource_group_name)
except Exception as ex: # pylint: disable=broad-except
azureError = getattr(ex, 'Azure Error', ex)
if hasattr(azureError, 'error') and hasattr(azureError.error, 'error'):
if azureError.error.error == 'ResourceGroupNotFound':
return None
except CloudError as ex:
if ex.status_code == 404:
return None
raise


Expand Down