Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 0 additions & 1 deletion pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ disable=
# These rules were added in Pylint >= 2.12, disable them to avoid making retroactive change
missing-timeout,
superfluous-parens,
implicit-str-concat,
unnecessary-dunder-call,
# These rules were added in Pylint >= 3.2
possibly-used-before-assignment,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ def ensure_cluster_identity_permission_on_kubelet_identity(cmd, cluster_identity
if use_shared_identity():
return
raise UnauthorizedError(
"Could not grant Managed Identity Operator " "permission to cluster identity at scope {}".format(scope)
"Could not grant Managed Identity Operator permission to cluster identity at scope {}".format(scope)
)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ def load_arguments(self, _):
c.argument('dapr_enable_api_logging', options_list=['--dapr-enable-api-logging', '--dal'], help="Enable/Disable API logging for the Dapr sidecar.", arg_type=get_three_state_flag(return_label=True))
c.argument('workload_profile_name', help="The name of the workload profile to run the app on.", is_preview=True)
c.argument('cpu', type=float, help="Required CPU in cores from 0.5 to 2.0.", is_preview=True)
c.argument('memory', help="Required momory from 1.0 to 4.0 ending with ""Gi"" e.g. 1.0Gi, ", is_preview=True)
c.argument('memory', help="Required momory from 1.0 to 4.0 ending with Gi e.g. 1.0Gi, ", is_preview=True)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the author wants to quote Gi:

Suggested change
c.argument('memory', help="Required momory from 1.0 to 4.0 ending with Gi e.g. 1.0Gi, ", is_preview=True)
c.argument('memory', help='Required momory from 1.0 to 4.0 ending with "Gi" e.g. 1.0Gi, ', is_preview=True)


with self.argument_context('functionapp runtime config') as c:
c.argument('runtime_version', help='The version of the functions runtime stack. Use "az functionapp list-flexconsumption-runtimes" to check supported runtimes and versions', is_preview=True)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def load_arguments(self, _):
"invoice_name",
options_list=["--name", "-n", "--invoice-name"],
type=str,
help="The ID that " "uniquely identifies an invoice.",
help="The ID that uniquely identifies an invoice.",
)
c.argument(
"by_subscription",
Expand Down Expand Up @@ -129,7 +129,7 @@ def load_arguments(self, _):
"name",
options_list=["--name", "-n"],
type=str,
help="The ID that uniquely identifies a role " "assignment.",
help="The ID that uniquely identifies a role assignment.",
)
c.argument(
"profile_name",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ def create_action(action_name, cache_behavior=None, cache_duration=None, header_
action = {
"cache_key_query_string": {
"parameters": {
"type_name" "DeliveryRuleCacheKeyQueryStringBehaviorActionParameters"
"type_name": "DeliveryRuleCacheKeyQueryStringBehaviorActionParameters",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't imagine how the code still works while it is as wrong as such.

"query_string_behavior": query_string_behavior,
"query_parameters": query_parameters
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,17 @@ def load_arguments(self, _):
'namespace',
completer=get_providers_completion_list,
arg_group='Resource ID',
help='Provider namespace (Ex: ''Microsoft.Provider'').')
help='Provider namespace (Ex: Microsoft.Provider).')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the author actually wants to quote Microsoft.Provider, but used the PowerShell syntax:

> echo "a""b"
a"b
> echo 'a''b'
a'b
Suggested change
help='Provider namespace (Ex: Microsoft.Provider).')
help="Provider namespace (Ex: 'Microsoft.Provider').")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the following three help messages be kept consistent? Personally, I think when parentheses are used, having or not having double quotes is fine.

c.argument(
'resource_type_parent',
options_list=['--parent'],
arg_group='Resource ID',
help='The parent path (Ex: ''resourceTypeA/nameA/resourceTypeB/nameB'').')
help='The parent path (Ex: resourceTypeA/nameA/resourceTypeB/nameB).')
c.argument(
'resource_type',
completer=get_resource_types_completion_list,
arg_group='Resource ID',
help='Resource type (Ex: ''resourceTypeC'').')
help='Resource type (Ex: resourceTypeC).')

for scope in ['state', 'event']:
with self.argument_context('policy {}'.format(scope)) as c:
Expand Down Expand Up @@ -137,7 +137,7 @@ def load_arguments(self, _):
'location_filters',
options_list='--location-filters',
nargs='+',
help='Space separated list of resource locations that should be remediated (Ex: ''centralus westeurope'').') # pylint: disable=line-too-long
help='Space separated list of resource locations that should be remediated (Ex: centralus westeurope).') # pylint: disable=line-too-long
c.argument(
'policy_assignment',
options_list=['--policy-assignment', '-a'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def test_relay_hyco(self, resource_group):
'loc': 'westus2',
'rg': resource_group,
'namespacename': self.create_random_name(prefix='relay-nscli', length=20),
'tags': 'tag1=value1' 'tag2=value2',
'tags': 'tag1=value1 tag2=value2',
'authoname': self.create_random_name(prefix='cliAutho', length=20),
'defaultauthorizationrule': 'RootManageSharedAccessKey',
'accessrights': 'Listen',
Expand Down Expand Up @@ -185,7 +185,7 @@ def test_relay_wcfrelay(self, resource_group):
'rg': resource_group,
'relaytype': 'Http',
'namespacename': self.create_random_name(prefix='relay-nscli', length=20),
'tags': 'tag1=value1' 'tag2=value2',
'tags': 'tag1=value1 tag2=value2',
'authoname': self.create_random_name(prefix='cliAutho', length=20),
'defaultauthorizationrule': 'RootManageSharedAccessKey',
'accessrights': 'Send',
Expand Down
8 changes: 4 additions & 4 deletions src/azure-cli/azure/cli/command_modules/search/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def pre_operations(self):

if args.hosting_mode == "highDensity" and args.sku != "standard3":
raise UnrecognizedArgumentError(
"SearchService.HostingMode: ""highDensity"" is only allowed when sku is ""standard3""")
"SearchService.HostingMode: highDensity is only allowed when sku is standard3")

if has_value(args.ip_rules):
ip_rules = re.split(';|,', args.ip_rules.to_serialized_data())
Expand Down Expand Up @@ -173,7 +173,7 @@ def update_search_service(instance, partition_count=0, replica_count=0, public_n
if public_network_access:
if (public_network_access.lower() not in ["enabled", "disabled"]):
raise UnrecognizedArgumentError(
"SearchService.PublicNetworkAccess: only [""enabled"", ""disabled""] are allowed")
"SearchService.PublicNetworkAccess: only [enabled, disabled] are allowed")
instance.public_network_access = public_network_access
if ip_rules:
_ip_rules = []
Expand Down Expand Up @@ -318,12 +318,12 @@ def setup_search_auth(instance, disable_local_auth, auth_options, aad_auth_failu
# Done by argument define
if (auth_options is not None and auth_options not in ["aadOrApiKey", "apiKeyOnly"]):
raise UnrecognizedArgumentError(
"SearchService.AuthOptions: only [""aadOrApiKey"", ""apiKeyOnly""] are allowed")
"SearchService.AuthOptions: only [aadOrApiKey, apiKeyOnly] are allowed")
# Done in aaz by default
if (aad_auth_failure_mode is not None and aad_auth_failure_mode not in ["http401WithBearerChallenge", "http403"]):
raise UnrecognizedArgumentError(
"SearchService.AuthOptions.AadAuthFailureMode: only "
"[""http401WithBearerChallenge"", ""http403""] are allowed")
"[http401WithBearerChallenge, http403] are allowed")

# Done in pre_operations
if disable_local_auth and auth_options:
Expand Down
4 changes: 2 additions & 2 deletions src/azure-cli/azure/cli/command_modules/sql/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ def _find_edition_capability(sku, supported_editions):
return next(e for e in supported_editions if e.name == sku.tier)
except StopIteration:
candidate_editions = [e.name for e in supported_editions]
raise CLIError('Could not find tier ''{}''. Supported tiers are: {}'.format(
raise CLIError('Could not find tier {}. Supported tiers are: {}'.format(
sku.tier, candidate_editions
))
else:
Expand All @@ -304,7 +304,7 @@ def _find_family_capability(sku, supported_families):
return next(f for f in supported_families if f.name == sku.family)
except StopIteration:
candidate_families = [e.name for e in supported_families]
raise CLIError('Could not find family ''{}''. Supported families are: {}'.format(
raise CLIError('Could not find family {}. Supported families are: {}'.format(
sku.family, candidate_families
))
else:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ def get_custom_sdk(custom_module, client_factory, resource_type=ResourceType.DAT
g.storage_custom_command_oauth('generate-sas', 'generate_sas_blob_uri')

blob_service_sdk = CliCommandType(
operations_tmpl='azure.multiapi.storagev2.blob._blob_service_client#' 'BlobServiceClient.{}',
operations_tmpl='azure.multiapi.storagev2.blob._blob_service_client#BlobServiceClient.{}',
client_factory=cf_blob_service,
resource_type=ResourceType.DATA_STORAGE_BLOB
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def load_arguments(self, _):
c.argument('sql_admin_login_password', options_list=['--sql-admin-login-password', '-p'],
help='The sql administrator login password.')
c.argument('tags', arg_type=tags_type)
c.argument('allowed_aad_tenant_ids', options_list=['--allowed-tenant-ids'], nargs='+', help="The approved Azure AD tenants which outbound data traffic allowed to. The Azure AD tenant of the current user will be included by default. Use ""(\'""\' in PowerShell) to disable all allowed tenant ids.")
c.argument('allowed_aad_tenant_ids', options_list=['--allowed-tenant-ids'], nargs='+', help="The approved Azure AD tenants which outbound data traffic allowed to. The Azure AD tenant of the current user will be included by default. Use \"\" or '' ('\"\"' in PowerShell) to disable all allowed tenant ids.")
c.argument('key_name', help='The workspace customer-managed key display name. All existing keys can be found using "az synapse workspace key list" cmdlet.')
c.argument('repository_type', arg_group=repository_arg_group, arg_type=get_enum_type(['AzureDevOpsGit', 'GitHub']), validator=validate_repository_type, help='The repository configuration type.')
c.argument('host_name', arg_group=repository_arg_group, help='If using github Enterprise Server, provide sever URL. Do not use this option with GitHub Enterprise Cloud.')
Expand Down