зеркало из https://github.com/Azure/azure-cli.git
{Pylint} Remove some invalid disable=unused-argument
This commit is contained in:
Родитель
ec666ca931
Коммит
5d5348899c
|
@ -233,7 +233,7 @@ class AAZCompoundTypeArgAction(AAZArgAction): # pylint: disable=abstract-method
|
|||
return tuple(valid_key_items), schema
|
||||
|
||||
@classmethod
|
||||
def _decode_value(cls, schema, value): # pylint: disable=unused-argument
|
||||
def _decode_value(cls, schema, value):
|
||||
from ._arg import AAZSimpleTypeArg
|
||||
from azure.cli.core.util import get_file_json, shell_safe_json_parse, get_file_yaml
|
||||
|
||||
|
|
|
@ -2686,7 +2686,7 @@ def aks_agentpool_operation_abort(cmd,
|
|||
return sdk_no_wait(no_wait, client.begin_abort_latest_operation, resource_group_name, cluster_name, nodepool_name)
|
||||
|
||||
|
||||
def aks_operation_abort(cmd, # pylint: disable=unused-argument
|
||||
def aks_operation_abort(cmd,
|
||||
client,
|
||||
resource_group_name,
|
||||
name,
|
||||
|
@ -2705,7 +2705,7 @@ def aks_operation_abort(cmd, # pylint: disable=unused-argument
|
|||
return sdk_no_wait(no_wait, client.begin_abort_latest_operation, resource_group_name, name)
|
||||
|
||||
|
||||
def aks_agentpool_delete_machines(cmd, # pylint: disable=unused-argument
|
||||
def aks_agentpool_delete_machines(cmd,
|
||||
client,
|
||||
resource_group_name,
|
||||
cluster_name,
|
||||
|
@ -2805,7 +2805,7 @@ def aks_nodepool_snapshot_create(cmd, # pylint: disable=too-many-locals,too-m
|
|||
return client.create_or_update(resource_group_name, snapshot_name, snapshot, headers=aks_custom_headers)
|
||||
|
||||
|
||||
def aks_nodepool_snapshot_update(cmd, client, resource_group_name, snapshot_name, tags): # pylint: disable=unused-argument
|
||||
def aks_nodepool_snapshot_update(cmd, client, resource_group_name, snapshot_name, tags):
|
||||
TagsObject = cmd.get_models(
|
||||
"TagsObject",
|
||||
resource_type=ResourceType.MGMT_CONTAINERSERVICE,
|
||||
|
@ -3266,7 +3266,6 @@ def aks_approuting_zone_list(
|
|||
raise CLIError('App routing addon is not enabled')
|
||||
|
||||
|
||||
# pylint: disable=unused-argument
|
||||
def _aks_approuting_update(
|
||||
cmd,
|
||||
client,
|
||||
|
|
|
@ -44,8 +44,8 @@ def aro_create(cmd, # pylint: disable=too-many-locals
|
|||
resource_name,
|
||||
master_subnet,
|
||||
worker_subnet,
|
||||
vnet=None, # pylint: disable=unused-argument
|
||||
vnet_resource_group_name=None, # pylint: disable=unused-argument
|
||||
vnet=None,
|
||||
vnet_resource_group_name=None,
|
||||
enable_preconfigured_nsg=False,
|
||||
location=None,
|
||||
pull_secret=None,
|
||||
|
@ -301,21 +301,21 @@ def validate(cmd, # pylint: disable=too-many-locals,too-many-statements
|
|||
|
||||
|
||||
def aro_validate(cmd, # pylint: disable=too-many-locals,too-many-statements
|
||||
client, # pylint: disable=unused-argument
|
||||
resource_group_name, # pylint: disable=unused-argument
|
||||
resource_name, # pylint: disable=unused-argument
|
||||
client,
|
||||
resource_group_name,
|
||||
resource_name,
|
||||
master_subnet,
|
||||
worker_subnet,
|
||||
vnet=None,
|
||||
cluster_resource_group=None, # pylint: disable=unused-argument
|
||||
cluster_resource_group=None,
|
||||
client_id=None,
|
||||
client_secret=None, # pylint: disable=unused-argument
|
||||
vnet_resource_group_name=None, # pylint: disable=unused-argument
|
||||
client_secret=None,
|
||||
vnet_resource_group_name=None,
|
||||
disk_encryption_set=None,
|
||||
location=None, # pylint: disable=unused-argument
|
||||
location=None,
|
||||
version=None,
|
||||
pod_cidr=None, # pylint: disable=unused-argument
|
||||
service_cidr=None, # pylint: disable=unused-argument
|
||||
pod_cidr=None,
|
||||
service_cidr=None,
|
||||
):
|
||||
|
||||
validate(cmd,
|
||||
|
|
|
@ -79,7 +79,7 @@ class HDInsightCompleter:
|
|||
self.timeout = timeout
|
||||
self.worker_result = []
|
||||
|
||||
def complete(self, cmd, prefix, namespace): # pylint: disable=unused-argument
|
||||
def complete(self, cmd, prefix, namespace):
|
||||
thread = threading.Thread(target=self.complete_worker, args=[self.worker, cmd, prefix, namespace])
|
||||
thread.daemon = True
|
||||
thread.start()
|
||||
|
|
|
@ -229,7 +229,7 @@ def get_deleted_vault_or_hsm(cmd, client, location=None, vault_name=None, hsm_na
|
|||
return hsm_client.get_deleted(name=hsm_name, location=location)
|
||||
|
||||
|
||||
def purge_vault_or_hsm(cmd, client, location=None, vault_name=None, hsm_name=None, # pylint: disable=unused-argument
|
||||
def purge_vault_or_hsm(cmd, client, location=None, vault_name=None, hsm_name=None,
|
||||
no_wait=False):
|
||||
if is_azure_stack_profile(cmd) or vault_name:
|
||||
return sdk_no_wait(
|
||||
|
@ -316,7 +316,7 @@ def _create_network_rule_set(cmd, bypass=None, default_action=None):
|
|||
|
||||
|
||||
# region KeyVault Vault
|
||||
def get_default_policy(cmd, scaffold=False): # pylint: disable=unused-argument
|
||||
def get_default_policy(cmd, scaffold=False):
|
||||
"""
|
||||
Get a default certificate policy to be used with `az keyvault certificate create`
|
||||
:param bool scaffold: create a fully formed policy structure with default values
|
||||
|
@ -1475,7 +1475,7 @@ def update_key_rotation_policy(cmd, client, value, key_name=None):
|
|||
|
||||
|
||||
# region KeyVault Secret
|
||||
def download_secret(client, file_path, name=None, encoding=None, version=''): # pylint: disable=unused-argument
|
||||
def download_secret(client, file_path, name=None, encoding=None, version=''):
|
||||
""" Download a secret from a KeyVault. """
|
||||
if os.path.isfile(file_path) or os.path.isdir(file_path):
|
||||
raise CLIError("File or directory named '{}' already exists.".format(file_path))
|
||||
|
@ -1506,7 +1506,7 @@ def download_secret(client, file_path, name=None, encoding=None, version=''): #
|
|||
raise ex
|
||||
|
||||
|
||||
def backup_secret(client, file_path, name=None): # pylint: disable=unused-argument
|
||||
def backup_secret(client, file_path, name=None):
|
||||
backup = client.backup_secret(name)
|
||||
with open(file_path, 'wb') as output:
|
||||
output.write(backup)
|
||||
|
@ -1709,8 +1709,7 @@ def _update_private_endpoint_connection_status(cmd, client, resource_group_name,
|
|||
if no_wait:
|
||||
return retval
|
||||
|
||||
new_retval = \
|
||||
_wait_private_link_operation(client, resource_group_name, name, private_endpoint_connection_name)
|
||||
new_retval = _wait_private_link_operation(client, resource_group_name, name, private_endpoint_connection_name)
|
||||
|
||||
if new_retval:
|
||||
return new_retval
|
||||
|
|
|
@ -232,7 +232,7 @@ class DiagnosticSettingsCategoryShow(_DiagnosticSettingsCategoryShow):
|
|||
update_resource_parameters(ctx)
|
||||
|
||||
|
||||
# pylint: disable=unused-argument, line-too-long
|
||||
# pylint: disable=line-too-long
|
||||
def create_diagnostics_settings(client, name, resource_uri,
|
||||
logs=None,
|
||||
metrics=None,
|
||||
|
|
|
@ -139,7 +139,6 @@ def get_key_value_pair(string):
|
|||
return result
|
||||
|
||||
|
||||
# pylint: disable=unused-argument
|
||||
def cli_redis_create_server_link(cmd, client, resource_group_name, name, server_to_link, replication_role):
|
||||
redis_client = cf_redis(cmd.cli_ctx)
|
||||
from azure.cli.core.commands.client_factory import get_subscription_id
|
||||
|
|
|
@ -74,7 +74,7 @@ def validate_cert(namespace):
|
|||
namespace.cert = x509
|
||||
|
||||
|
||||
def process_assignment_namespace(cmd, namespace): # pylint: disable=unused-argument
|
||||
def process_assignment_namespace(cmd, namespace):
|
||||
# Make sure these arguments are non-empty strings.
|
||||
# When they are accidentally provided as an empty string "", they won't take effect when filtering the role
|
||||
# assignments, causing all matched role assignments to be listed/deleted. For example,
|
||||
|
|
|
@ -78,7 +78,6 @@ def storage_remove(cmd, client, service, target, recursive=None, exclude_pattern
|
|||
azcopy.remove(_add_url_sas(target, sas_token), flags=flags)
|
||||
|
||||
|
||||
# pylint: disable=unused-argument
|
||||
def storage_fs_directory_copy(cmd, source, destination, recursive=None, **kwargs):
|
||||
azcopy = AzCopy()
|
||||
if kwargs.get('token_credential'):
|
||||
|
|
|
@ -1879,7 +1879,7 @@ def process_vmss_create_namespace(cmd, namespace):
|
|||
_validate_community_gallery_legal_agreement_acceptance(cmd, namespace)
|
||||
|
||||
|
||||
def validate_vmss_update_namespace(cmd, namespace): # pylint: disable=unused-argument
|
||||
def validate_vmss_update_namespace(cmd, namespace):
|
||||
if not namespace.instance_id:
|
||||
if namespace.protect_from_scale_in is not None or namespace.protect_from_scale_set_actions is not None:
|
||||
raise CLIError("usage error: protection policies can only be applied to VM instances within a VMSS."
|
||||
|
@ -2202,7 +2202,7 @@ def process_remove_identity_namespace(cmd, namespace):
|
|||
'Microsoft.ManagedIdentity')
|
||||
|
||||
|
||||
def process_set_applications_namespace(cmd, namespace): # pylint: disable=unused-argument
|
||||
def process_set_applications_namespace(cmd, namespace):
|
||||
_validate_vm_vmss_set_applications(cmd, namespace)
|
||||
|
||||
|
||||
|
@ -2519,7 +2519,7 @@ def process_vm_vmss_stop(cmd, namespace): # pylint: disable=unused-argument
|
|||
"To deallocate a VM, run: az vm deallocate.")
|
||||
|
||||
|
||||
def _validate_vmss_update_terminate_notification_related(cmd, namespace): # pylint: disable=unused-argument
|
||||
def _validate_vmss_update_terminate_notification_related(cmd, namespace):
|
||||
"""
|
||||
Validate vmss update enable_terminate_notification and terminate_notification_time.
|
||||
If terminate_notification_time is specified, enable_terminate_notification should not be false
|
||||
|
@ -2540,7 +2540,7 @@ def _validate_vmss_terminate_notification(cmd, namespace): # pylint: disable=un
|
|||
namespace.terminate_notification_time = 'PT' + namespace.terminate_notification_time + 'M'
|
||||
|
||||
|
||||
def _validate_vmss_create_automatic_repairs(cmd, namespace): # pylint: disable=unused-argument
|
||||
def _validate_vmss_create_automatic_repairs(cmd, namespace):
|
||||
if namespace.automatic_repairs_grace_period is not None or namespace.automatic_repairs_action is not None:
|
||||
if namespace.load_balancer is None or namespace.health_probe is None:
|
||||
raise ArgumentUsageError("usage error: --load-balancer and --health-probe are required "
|
||||
|
@ -2548,7 +2548,7 @@ def _validate_vmss_create_automatic_repairs(cmd, namespace): # pylint: disable=
|
|||
_validate_vmss_automatic_repairs(cmd, namespace)
|
||||
|
||||
|
||||
def _validate_vmss_update_automatic_repairs(cmd, namespace): # pylint: disable=unused-argument
|
||||
def _validate_vmss_update_automatic_repairs(cmd, namespace):
|
||||
if namespace.enable_automatic_repairs is False and \
|
||||
(namespace.automatic_repairs_grace_period is not None or namespace.automatic_repairs_action is not None):
|
||||
raise ArgumentUsageError("usage error: please enable --enable-automatic-repairs")
|
||||
|
|
Загрузка…
Ссылка в новой задаче