From 33dbb2a59e9b4b1571ef5e8f1aba9859c796c5ea Mon Sep 17 00:00:00 2001 From: MyronFanQiu Date: Fri, 15 May 2020 11:18:06 +0800 Subject: [PATCH 1/3] fix --- src/azure-cli-core/azure/cli/core/commands/template_create.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/azure-cli-core/azure/cli/core/commands/template_create.py b/src/azure-cli-core/azure/cli/core/commands/template_create.py index d9733d4f64e..4e9b047db1f 100644 --- a/src/azure-cli-core/azure/cli/core/commands/template_create.py +++ b/src/azure-cli-core/azure/cli/core/commands/template_create.py @@ -43,7 +43,7 @@ def get_folded_parameter_help_string( # add parent name option string (if applicable) if other_required_option: help_text = '{} If name specified, also specify {}.'.format(help_text, other_required_option) - help_text = '{} If you want to use an existing {display_name} in other resource group or subscription, ' \ + help_text = '{} If you want to use an existing {display_name} in other resource group or subscription (may not be supportted), ' \ 'please provide the ID instead of the name of the {display_name}'.format(help_text, display_name=display_name) return help_text From a66b31ac031780dd4f5a9c4f46aa6777efa19147 Mon Sep 17 00:00:00 2001 From: MyronFanQiu Date: Fri, 15 May 2020 11:23:09 +0800 Subject: [PATCH 2/3] fix --- .../azure/cli/core/commands/template_create.py | 7 ++++--- src/azure-cli/azure/cli/command_modules/network/_params.py | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/azure-cli-core/azure/cli/core/commands/template_create.py b/src/azure-cli-core/azure/cli/core/commands/template_create.py index 4e9b047db1f..8832adfc924 100644 --- a/src/azure-cli-core/azure/cli/core/commands/template_create.py +++ b/src/azure-cli-core/azure/cli/core/commands/template_create.py @@ -16,7 +16,7 @@ def get_folded_parameter_help_string( display_name, allow_none=False, allow_new=False, default_none=False, - other_required_option=None): + other_required_option=None, allow_cross_sub=True): """ Assembles a parameterized help string for folded parameters. """ quotes = '""' if platform.system() == 'Windows' else "''" @@ -43,9 +43,10 @@ def get_folded_parameter_help_string( # add parent name option string (if applicable) if other_required_option: help_text = '{} If name specified, also specify {}.'.format(help_text, other_required_option) - help_text = '{} If you want to use an existing {display_name} in other resource group or subscription (may not be supportted), ' \ + help_text = '{} If you want to use an existing {display_name} in other resource group{append_sub}, ' \ 'please provide the ID instead of the name of the {display_name}'.format(help_text, - display_name=display_name) + display_name=display_name, + append_sub= " or subscription" if allow_cross_sub else "") return help_text diff --git a/src/azure-cli/azure/cli/command_modules/network/_params.py b/src/azure-cli/azure/cli/command_modules/network/_params.py index b55106852f2..13585e0434a 100644 --- a/src/azure-cli/azure/cli/command_modules/network/_params.py +++ b/src/azure-cli/azure/cli/command_modules/network/_params.py @@ -938,7 +938,7 @@ def load_arguments(self, _): nsg_help = get_folded_parameter_help_string('network security group', allow_none=True, default_none=True) c.argument('network_security_group', help=nsg_help, completer=get_resource_name_completion_list('Microsoft.Network/networkSecurityGroups')) - subnet_help = get_folded_parameter_help_string('subnet', other_required_option='--vnet-name') + subnet_help = get_folded_parameter_help_string('subnet', other_required_option='--vnet-name', allow_cross_sub=False) c.argument('subnet', help=subnet_help, completer=subnet_completion_list) with self.argument_context('network nic update') as c: From 08d2c596ec1bec265dcd95dc9078d7c995ee83d7 Mon Sep 17 00:00:00 2001 From: MyronFanQiu Date: Fri, 15 May 2020 11:36:12 +0800 Subject: [PATCH 3/3] fix style --- src/azure-cli-core/azure/cli/core/commands/template_create.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/azure-cli-core/azure/cli/core/commands/template_create.py b/src/azure-cli-core/azure/cli/core/commands/template_create.py index 8832adfc924..6834b175e00 100644 --- a/src/azure-cli-core/azure/cli/core/commands/template_create.py +++ b/src/azure-cli-core/azure/cli/core/commands/template_create.py @@ -43,10 +43,11 @@ def get_folded_parameter_help_string( # add parent name option string (if applicable) if other_required_option: help_text = '{} If name specified, also specify {}.'.format(help_text, other_required_option) + extra_sub_text = " or subscription" if allow_cross_sub else "" help_text = '{} If you want to use an existing {display_name} in other resource group{append_sub}, ' \ 'please provide the ID instead of the name of the {display_name}'.format(help_text, display_name=display_name, - append_sub= " or subscription" if allow_cross_sub else "") + append_sub=extra_sub_text) return help_text