From 74f8c4fa4f1fc0951da90bbd7c9a74a49c5ba852 Mon Sep 17 00:00:00 2001 From: Rodrigo Mendoza <43052640+rosanch@users.noreply.github.com> Date: Fri, 28 May 2021 17:17:28 -0700 Subject: [PATCH 1/3] bug fix --- src/azure-cli/azure/cli/command_modules/acr/_params.py | 4 ++-- .../azure/cli/command_modules/acr/connected_registry.py | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/azure-cli/azure/cli/command_modules/acr/_params.py b/src/azure-cli/azure/cli/command_modules/acr/_params.py index b0b847b56c5..b0b3ed68b74 100644 --- a/src/azure-cli/azure/cli/command_modules/acr/_params.py +++ b/src/azure-cli/azure/cli/command_modules/acr/_params.py @@ -421,9 +421,9 @@ def load_arguments(self, _): # pylint: disable=too-many-statements with self.argument_context('acr connected-registry update') as c: c.argument('log_level', help='Sets the log level for logging on the instance. Accepted log levels are Debug, Information, Warning, Error, and None.', required=False) c.argument('add_client_token_list', options_list=['--add-client-tokens'], nargs='*', required=False, - help='Client tokens to be added. Use the format "--add-client-tokens [TOKEN_ID1 TOKEN_ID2 ...]" per token id.') + help='Client tokens to be added. Use the format "--add-client-tokens [TOKEN_NAME1 TOKEN_NAME2 ...]" per token id.') c.argument('remove_client_token_list', options_list=['--remove-client-tokens'], nargs='*', required=False, - help='Client tokens to be removed. Use the format "--remove-client-tokens [TOKEN_ID1 TOKEN_ID2 ...]" per token id.') + help='Client tokens to be removed. Use the format "--remove-client-tokens [TOKEN_NAME1 TOKEN_NAME2 ...]" per token id.') c.argument('sync_window', options_list=['--sync-window', '-w'], help='Used to determine the schedule duration. Uses ISO 8601 duration format.', required=False) c.argument('sync_schedule', options_list=['--sync-schedule', '-s'], help='Optional parameter to define the sync schedule. Uses cron expression to determine the schedule. If not specified, the instance is considered always online and attempts to sync every minute.', required=False) c.argument('sync_message_ttl', help='Determines how long the sync messages will be kept in the cloud. Uses ISO 8601 duration format.', required=False) diff --git a/src/azure-cli/azure/cli/command_modules/acr/connected_registry.py b/src/azure-cli/azure/cli/command_modules/acr/connected_registry.py index e34535a62bf..8d00c7e9d37 100644 --- a/src/azure-cli/azure/cli/command_modules/acr/connected_registry.py +++ b/src/azure-cli/azure/cli/command_modules/acr/connected_registry.py @@ -63,7 +63,9 @@ def acr_connected_registry_create(cmd, # pylint: disable=too-many-locals, too-m sync_audit_logs_enabled=False): if bool(sync_token_name) == bool(repositories): - raise CLIError("usage error: you need to provide either --sync-token-name or --repository, but not both.") + raise CLIError("usage error: you must provide either --sync-token-name or --repository, but not both.") + if (len(connected_registry_name) < 5): # Check needed since the sync token gateway actions must be at least 5 characters long. + raise CLIError("argument error: Connected registry name must be at least 5 characters long") registry, resource_group_name = get_registry_by_name(cmd.cli_ctx, registry_name, resource_group_name) subscription_id = get_subscription_id(cmd.cli_ctx) From c9647aeca0c871d9435e4de40a3fbf2f4c6a5b48 Mon Sep 17 00:00:00 2001 From: Rodrigo Mendoza <43052640+rosanch@users.noreply.github.com> Date: Wed, 2 Jun 2021 12:26:21 -0700 Subject: [PATCH 2/3] pylint fix --- .../azure/cli/command_modules/acr/connected_registry.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/azure-cli/azure/cli/command_modules/acr/connected_registry.py b/src/azure-cli/azure/cli/command_modules/acr/connected_registry.py index 8d00c7e9d37..5e534f0b363 100644 --- a/src/azure-cli/azure/cli/command_modules/acr/connected_registry.py +++ b/src/azure-cli/azure/cli/command_modules/acr/connected_registry.py @@ -64,7 +64,8 @@ def acr_connected_registry_create(cmd, # pylint: disable=too-many-locals, too-m if bool(sync_token_name) == bool(repositories): raise CLIError("usage error: you must provide either --sync-token-name or --repository, but not both.") - if (len(connected_registry_name) < 5): # Check needed since the sync token gateway actions must be at least 5 characters long. + # Check needed since the sync token gateway actions must be at least 5 characters long. + if len(connected_registry_name) < 5: raise CLIError("argument error: Connected registry name must be at least 5 characters long") registry, resource_group_name = get_registry_by_name(cmd.cli_ctx, registry_name, resource_group_name) subscription_id = get_subscription_id(cmd.cli_ctx) From e4a992e2f02413bb38dd444bc470e27f979fa48a Mon Sep 17 00:00:00 2001 From: Zunli Hu Date: Thu, 10 Jun 2021 15:30:48 +0800 Subject: [PATCH 3/3] fix style --- .../azure/cli/command_modules/acr/connected_registry.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/azure-cli/azure/cli/command_modules/acr/connected_registry.py b/src/azure-cli/azure/cli/command_modules/acr/connected_registry.py index 5e534f0b363..56694acfb80 100644 --- a/src/azure-cli/azure/cli/command_modules/acr/connected_registry.py +++ b/src/azure-cli/azure/cli/command_modules/acr/connected_registry.py @@ -65,7 +65,7 @@ def acr_connected_registry_create(cmd, # pylint: disable=too-many-locals, too-m if bool(sync_token_name) == bool(repositories): raise CLIError("usage error: you must provide either --sync-token-name or --repository, but not both.") # Check needed since the sync token gateway actions must be at least 5 characters long. - if len(connected_registry_name) < 5: + if len(connected_registry_name) < 5: raise CLIError("argument error: Connected registry name must be at least 5 characters long") registry, resource_group_name = get_registry_by_name(cmd.cli_ctx, registry_name, resource_group_name) subscription_id = get_subscription_id(cmd.cli_ctx)