-
Notifications
You must be signed in to change notification settings - Fork 3.4k
[ACR] Fix some bugs on uncovered cmds #18786
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -76,7 +76,7 @@ def acr_connected_registry_create(cmd, # pylint: disable=too-many-locals, too-m | |
| "Enabling the data endpoint might affect your firewall rules.\nTo enable data endpoint run:" + | ||
| "\n\taz acr update -n {} --data-endpoint-enabled true".format(registry_name)) | ||
|
|
||
| ErrorResponseException = cmd.get_models('ErrorResponseException') | ||
| from azure.core.exceptions import HttpResponseError as ErrorResponseException | ||
| parent = None | ||
| mode = mode.capitalize() | ||
| if parent_name: | ||
|
|
@@ -129,11 +129,11 @@ def acr_connected_registry_create(cmd, # pylint: disable=too-many-locals, too-m | |
| ) | ||
|
|
||
| try: | ||
| return client.create(subscription_id=subscription_id, | ||
| resource_group_name=resource_group_name, | ||
| registry_name=registry_name, | ||
| connected_registry_name=connected_registry_name, | ||
| connected_registry_create_parameters=connected_registry_create_parameters) | ||
| return client.begin_create(subscription_id=subscription_id, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why do you need to change the code from xyz to begin_xyz? What is the difference between the two?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. https://github.com/Azure/azure-cli/blob/dev/doc/track_2_migration_guidance.md#long-running-operation-function-name-change, no behavior change, only method name change in SDK.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Refer to this Guide |
||
| resource_group_name=resource_group_name, | ||
| registry_name=registry_name, | ||
| connected_registry_name=connected_registry_name, | ||
| connected_registry_create_parameters=connected_registry_create_parameters) | ||
| except ValidationError as e: | ||
| raise CLIError(e) | ||
|
|
||
|
|
@@ -202,10 +202,10 @@ def acr_connected_registry_update(cmd, # pylint: disable=too-many-locals, too-m | |
| ) | ||
|
|
||
| try: | ||
| return client.update(resource_group_name=resource_group_name, | ||
| registry_name=registry_name, | ||
| connected_registry_name=connected_registry_name, | ||
| connected_registry_update_parameters=connected_registry_update_parameters) | ||
| return client.begin_update(resource_group_name=resource_group_name, | ||
| registry_name=registry_name, | ||
| connected_registry_name=connected_registry_name, | ||
| connected_registry_update_parameters=connected_registry_update_parameters) | ||
| except ValidationError as e: | ||
| raise CLIError(e) | ||
|
|
||
|
|
@@ -224,7 +224,7 @@ def acr_connected_registry_delete(cmd, | |
| try: | ||
| connected_registry = acr_connected_registry_show( | ||
| cmd, client, connected_registry_name, registry_name, resource_group_name) | ||
| result = client.delete(resource_group_name, registry_name, connected_registry_name) | ||
| result = client.begin_delete(resource_group_name, registry_name, connected_registry_name) | ||
| sync_token = get_token_from_id(cmd, connected_registry.parent.sync_properties.token_id) | ||
| sync_token_name = sync_token.name | ||
| sync_scope_map_name = sync_token.scope_map_id.split('/scopeMaps/')[1] | ||
|
|
@@ -268,10 +268,10 @@ def acr_connected_registry_deactivate(cmd, | |
|
|
||
| user_confirmation("Are you sure you want to deactivate the connected registry '{}' in '{}'?".format( | ||
| connected_registry_name, registry_name), yes) | ||
| return client.deactivate(subscription_id=subscription_id, | ||
| resource_group_name=resource_group_name, | ||
| registry_name=registry_name, | ||
| connected_registry_name=connected_registry_name) | ||
| return client.begin_deactivate(subscription_id=subscription_id, | ||
| resource_group_name=resource_group_name, | ||
| registry_name=registry_name, | ||
| connected_registry_name=connected_registry_name) | ||
|
|
||
|
|
||
| def acr_connected_registry_list(cmd, | ||
|
|
@@ -355,7 +355,7 @@ def _create_sync_token(cmd, | |
| sync_token_name = SYNC_TOKEN_NAME.format(connected_registry_name) | ||
| logger.warning("If sync token '%s' already exists, it properties will be overwritten", sync_token_name) | ||
| Token = cmd.get_models('Token') | ||
| poller = token_client.create( | ||
| poller = token_client.begin_create( | ||
| resource_group_name, | ||
| registry_name, | ||
| sync_token_name, | ||
|
|
@@ -520,7 +520,7 @@ def _update_repo_permissions(cmd, | |
| return None | ||
| current_actions = list(final_actions_set) | ||
| logger.warning(msg) | ||
| return scope_map_client.update( | ||
| return scope_map_client.begin_update( | ||
| resource_group_name, | ||
| registry_name, | ||
| sync_scope_map_name, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the type same as before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically, yes. Track2 SDK has removed all these Exceptions in models.