Skip to content

Commit 3f3360c

Browse files
committed
fix
1 parent 639e80d commit 3f3360c

2 files changed

Lines changed: 13 additions & 8 deletions

File tree

src/azure-cli/azure/cli/command_modules/acr/_params.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -304,11 +304,8 @@ def load_arguments(self, _): # pylint: disable=too-many-statements
304304
help_str += ' Default: true.' if 'create' in scope else '' # suffix help with default if command is for create
305305

306306
with self.argument_context(scope) as c:
307-
c.argument('region_endpoint_enabled',
308-
options_list=['--global-endpoint-routing',
309-
c.deprecate(target='--region-endpoint-enabled',
310-
redirect='--global-endpoint-routing')],
311-
arg_type=get_three_state_flag(), help=help_str)
307+
c.argument('region_endpoint_enabled', arg_type=get_three_state_flag(), help=help_str)
308+
c.argument('global_endpoint_routing', arg_type=get_three_state_flag(), help=help_str)
312309

313310
with self.argument_context('acr run') as c:
314311
c.argument('registry_name', options_list=['--registry', '-r'])

src/azure-cli/azure/cli/command_modules/acr/replication.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,16 @@ def acr_replication_create(cmd,
3030
resource_group_name=None,
3131
replication_name=None,
3232
region_endpoint_enabled=None,
33+
global_endpoint_routing=None,
3334
zone_redundancy=None,
3435
tags=None):
3536
registry, resource_group_name = validate_premium_registry(
3637
cmd, registry_name, resource_group_name, REPLICATIONS_NOT_SUPPORTED)
3738

39+
# --global-endpoint-routing takes precedence over deprecated --region-endpoint-enabled
40+
if global_endpoint_routing is not None:
41+
region_endpoint_enabled = global_endpoint_routing
42+
3843
normalized_location = "".join(location.split()).lower()
3944
if registry.location == normalized_location:
4045
raise CLIError('Replication could not be created in the same location as the registry.')
@@ -80,12 +85,15 @@ def acr_replication_show(cmd,
8085
return client.get(resource_group_name, registry_name, replication_name)
8186

8287

83-
def acr_replication_update_custom(instance, region_endpoint_enabled=None, tags=None):
88+
def acr_replication_update_custom(instance, region_endpoint_enabled=None, global_endpoint_routing=None, tags=None):
8489
if tags is not None:
8590
instance.tags = tags
8691

87-
if region_endpoint_enabled is not None:
88-
instance.region_endpoint_enabled = region_endpoint_enabled
92+
# --global-endpoint-routing takes precedence over deprecated --region-endpoint-enabled
93+
effective_value = global_endpoint_routing if global_endpoint_routing is not None \
94+
else region_endpoint_enabled
95+
if effective_value is not None:
96+
instance.region_endpoint_enabled = effective_value
8997

9098
return instance
9199

0 commit comments

Comments
 (0)