diff --git a/pylintrc b/pylintrc index 788c73c7d91..3f54a6e7b8c 100644 --- a/pylintrc +++ b/pylintrc @@ -30,7 +30,6 @@ disable= no-value-for-parameter, raise-missing-from, subprocess-run-check, - super-with-arguments, too-many-arguments, too-many-positional-arguments, too-many-function-args, diff --git a/scripts/dump_command_table.py b/scripts/dump_command_table.py index a4c70bcea78..a6db3fd1970 100644 --- a/scripts/dump_command_table.py +++ b/scripts/dump_command_table.py @@ -16,7 +16,7 @@ class Exporter(json.JSONEncoder): def default(self, o):#pylint: disable=method-hidden try: - return super(Exporter, self).default(o) + return super().default(o) except TypeError: return str(o) diff --git a/scripts/dump_help.py b/scripts/dump_help.py index 9bdd9652088..8fc67e330ba 100644 --- a/scripts/dump_help.py +++ b/scripts/dump_help.py @@ -16,7 +16,7 @@ class Exporter(json.JSONEncoder): def default(self, o):#pylint: disable=method-hidden try: - return super(Exporter, self).default(o) + return super().default(o) except TypeError: return str(o) diff --git a/scripts/generate_command_inventory.py b/scripts/generate_command_inventory.py index d2271ab856a..b9dceeae0e3 100644 --- a/scripts/generate_command_inventory.py +++ b/scripts/generate_command_inventory.py @@ -14,7 +14,7 @@ class Exporter(json.JSONEncoder): def default(self, o):#pylint: disable=method-hidden try: - return super(Exporter, self).default(o) + return super().default(o) except TypeError: return str(o) diff --git a/src/azure-cli-core/azure/cli/core/__init__.py b/src/azure-cli-core/azure/cli/core/__init__.py index a98beca0be5..386bb239baa 100644 --- a/src/azure-cli-core/azure/cli/core/__init__.py +++ b/src/azure-cli-core/azure/cli/core/__init__.py @@ -56,7 +56,7 @@ def _configure_knack(): class AzCli(CLI): def __init__(self, **kwargs): - super(AzCli, self).__init__(**kwargs) + super().__init__(**kwargs) from azure.cli.core.breaking_change import register_upcoming_breaking_change_info from azure.cli.core.commands import register_cache_arguments @@ -200,7 +200,7 @@ class MainCommandsLoader(CLICommandsLoader): item_ext_format_string = item_format_string + " %s" def __init__(self, cli_ctx=None): - super(MainCommandsLoader, self).__init__(cli_ctx) + super().__init__(cli_ctx) self.cmd_to_loader_map = {} self.loaders = [] @@ -677,9 +677,9 @@ def __init__(self, cli_ctx=None, command_group_cls=None, argument_context_cls=No suppress_extension=None, **kwargs): from azure.cli.core.commands import AzCliCommand, AzCommandGroup, AzArgumentContext - super(AzCommandsLoader, self).__init__(cli_ctx=cli_ctx, - command_cls=AzCliCommand, - excluded_command_handler_args=EXCLUDED_PARAMS) + super().__init__(cli_ctx=cli_ctx, + command_cls=AzCliCommand, + excluded_command_handler_args=EXCLUDED_PARAMS) self.suppress_extension = suppress_extension self.module_kwargs = kwargs self.command_name = None diff --git a/src/azure-cli-core/azure/cli/core/_help.py b/src/azure-cli-core/azure/cli/core/_help.py index 04987de97f4..9f192da76c9 100644 --- a/src/azure-cli-core/azure/cli/core/_help.py +++ b/src/azure-cli-core/azure/cli/core/_help.py @@ -50,7 +50,7 @@ # Most of these methods override print methods in CLIHelp class CLIPrintMixin(CLIHelp): def _print_header(self, cli_name, help_file): - super(CLIPrintMixin, self)._print_header(cli_name, help_file) + super()._print_header(cli_name, help_file) links = help_file.links if links: @@ -61,7 +61,7 @@ def _print_header(self, cli_name, help_file): def _print_detailed_help(self, cli_name, help_file): CLIPrintMixin._print_extensions_msg(help_file) - super(CLIPrintMixin, self)._print_detailed_help(cli_name, help_file) + super()._print_detailed_help(cli_name, help_file) self._print_az_find_message(help_file.command) @staticmethod @@ -131,12 +131,11 @@ def _print_extensions_msg(help_file): class AzCliHelp(CLIPrintMixin, CLIHelp): def __init__(self, cli_ctx): - super(AzCliHelp, self).__init__(cli_ctx, - privacy_statement=PRIVACY_STATEMENT, - welcome_message=WELCOME_MESSAGE, - command_help_cls=CliCommandHelpFile, - group_help_cls=CliGroupHelpFile, - help_cls=CliHelpFile) + super().__init__(cli_ctx, privacy_statement=PRIVACY_STATEMENT, + welcome_message=WELCOME_MESSAGE, + command_help_cls=CliCommandHelpFile, + group_help_cls=CliGroupHelpFile, + help_cls=CliHelpFile) from knack.help import HelpObject # TODO: This workaround is used to avoid a bizarre bug in Python 2.7. It @@ -247,7 +246,7 @@ class CliHelpFile(KnackHelpFile): def __init__(self, help_ctx, delimiters): # Each help file (for a command or group) has a version denoting the source of its data. - super(CliHelpFile, self).__init__(help_ctx, delimiters) + super().__init__(help_ctx, delimiters) self.links = [] from knack.deprecation import resolve_deprecate_info, ImplicitDeprecated, Deprecated @@ -376,7 +375,7 @@ def load(self, options): class CliCommandHelpFile(KnackCommandHelpFile, CliHelpFile): def __init__(self, help_ctx, delimiters, parser): - super(CliCommandHelpFile, self).__init__(help_ctx, delimiters, parser) + super().__init__(help_ctx, delimiters, parser) self.type = 'command' self.command_source = getattr(parser, 'command_source', None) @@ -409,7 +408,7 @@ def __init__(self, help_ctx, delimiters, parser): param.__class__ = HelpParameter def _load_from_data(self, data): - super(CliCommandHelpFile, self)._load_from_data(data) + super()._load_from_data(data) if isinstance(data, str) or not self.parameters or not data.get('parameters'): return @@ -433,7 +432,7 @@ class ArgumentGroupRegistry(KnackArgumentGroupRegistry): # pylint: disable=too- def __init__(self, group_list): - super(ArgumentGroupRegistry, self).__init__(group_list) + super().__init__(group_list) self.priorities = { None: 0, 'Resource Id Arguments': 1, @@ -454,7 +453,7 @@ def __init__(self, **_data): # Old attributes _data['name'] = _data.get('name', '') _data['text'] = _data.get('text', '') - super(HelpExample, self).__init__(_data) + super().__init__(_data) self.name = _data.get('summary', '') if _data.get('summary', '') else self.name self.text = _data.get('command', '') if _data.get('command', '') else self.text @@ -483,11 +482,8 @@ def command(self, value): class HelpParameter(KnackHelpParameter): # pylint: disable=too-many-instance-attributes - def __init__(self, **kwargs): - super(HelpParameter, self).__init__(**kwargs) - def update_from_data(self, data): - super(HelpParameter, self).update_from_data(data) + super().update_from_data(data) # original help.py value_sources are strings, update command strings to value-source dict if self.value_sources: self.value_sources = [str_or_dict if isinstance(str_or_dict, dict) else {"link": {"command": str_or_dict}} diff --git a/src/azure-cli-core/azure/cli/core/_session.py b/src/azure-cli-core/azure/cli/core/_session.py index 471a0344c27..edd6a954034 100644 --- a/src/azure-cli-core/azure/cli/core/_session.py +++ b/src/azure-cli-core/azure/cli/core/_session.py @@ -21,7 +21,7 @@ class Session(MutableMapping): """ def __init__(self, encoding=None): - super(Session, self).__init__() + super().__init__() self.filename = None self.data = {} self._encoding = encoding if encoding else 'utf-8-sig' diff --git a/src/azure-cli-core/azure/cli/core/aaz/_arg.py b/src/azure-cli-core/azure/cli/core/aaz/_arg.py index 14553b2048d..04ae0b3aee7 100644 --- a/src/azure-cli-core/azure/cli/core/aaz/_arg.py +++ b/src/azure-cli-core/azure/cli/core/aaz/_arg.py @@ -358,9 +358,6 @@ def _type_in_help(self): class AAZCompoundTypeArg(AAZBaseArg): - def __init__(self, **kwargs): - super().__init__(**kwargs) - @abc.abstractmethod def _build_cmd_action(self): raise NotImplementedError() diff --git a/src/azure-cli-core/azure/cli/core/aaz/_field_type.py b/src/azure-cli-core/azure/cli/core/aaz/_field_type.py index 30eaf23559b..7ad7b5a468e 100644 --- a/src/azure-cli-core/azure/cli/core/aaz/_field_type.py +++ b/src/azure-cli-core/azure/cli/core/aaz/_field_type.py @@ -24,9 +24,6 @@ class AAZSimpleType(AAZBaseType): _ValueCls = AAZSimpleValue - def __init__(self, *args, **kwargs): - super().__init__(*args, **kwargs) - def process_data(self, data, **kwargs): if data == None: # noqa: E711, pylint: disable=singleton-comparison # data can be None or AAZSimpleValue == None @@ -276,9 +273,6 @@ class AAZBaseDictType(AAZBaseType): _PatchDataCls = dict - def __init__(self, *args, **kwargs): - super().__init__(*args, **kwargs) - @abc.abstractmethod def __getitem__(self, key): raise NotImplementedError() diff --git a/src/azure-cli-core/azure/cli/core/azlogging.py b/src/azure-cli-core/azure/cli/core/azlogging.py index acb5add203a..73b5d091522 100644 --- a/src/azure-cli-core/azure/cli/core/azlogging.py +++ b/src/azure-cli-core/azure/cli/core/azlogging.py @@ -42,7 +42,7 @@ class AzCliLogging(CLILogging): COMMAND_METADATA_LOGGER = 'az_command_data_logger' def __init__(self, name, cli_ctx=None): - super(AzCliLogging, self).__init__(name, cli_ctx) + super().__init__(name, cli_ctx) self.command_log_dir = os.path.join(cli_ctx.config.config_dir, 'commands') self.command_logger_handler = None self.command_metadata_logger = None @@ -50,7 +50,7 @@ def __init__(self, name, cli_ctx=None): self.cli_ctx.register_event(EVENT_CLI_POST_EXECUTE, AzCliLogging.deinit_cmd_metadata_logging) def configure(self, args): - super(AzCliLogging, self).configure(args) + super().configure(args) from knack.log import CliLogLevel if self.log_level == CliLogLevel.DEBUG: # As azure.core.pipeline.policies.http_logging_policy is a redacted version of diff --git a/src/azure-cli-core/azure/cli/core/cloud.py b/src/azure-cli-core/azure/cli/core/cloud.py index 2ae62c26f5c..0db47564eec 100644 --- a/src/azure-cli-core/azure/cli/core/cloud.py +++ b/src/azure-cli-core/azure/cli/core/cloud.py @@ -29,7 +29,7 @@ class CloudNotRegisteredException(Exception): def __init__(self, cloud_name): - super(CloudNotRegisteredException, self).__init__(cloud_name) + super().__init__(cloud_name) self.cloud_name = cloud_name def __str__(self): @@ -38,7 +38,7 @@ def __str__(self): class CloudAlreadyRegisteredException(Exception): def __init__(self, cloud_name): - super(CloudAlreadyRegisteredException, self).__init__(cloud_name) + super().__init__(cloud_name) self.cloud_name = cloud_name def __str__(self): diff --git a/src/azure-cli-core/azure/cli/core/commands/__init__.py b/src/azure-cli-core/azure/cli/core/commands/__init__.py index f17e7862bba..9f366b4bc0b 100644 --- a/src/azure-cli-core/azure/cli/core/commands/__init__.py +++ b/src/azure-cli-core/azure/cli/core/commands/__init__.py @@ -255,13 +255,13 @@ def __getattribute__(self, key): payload = object.__getattribute__(self, '_payload') return payload.__getattribute__(key) except AttributeError: - return super(CacheObject, self).__getattribute__(key) + return super().__getattribute__(key) def __setattr__(self, key, value): try: return self._payload.__setattr__(key, value) except AttributeError: - return super(CacheObject, self).__setattr__(key, value) + return super().__setattr__(key, value) class AzCliCommand(CLICommand): @@ -269,10 +269,10 @@ class AzCliCommand(CLICommand): def __init__(self, loader, name, handler, description=None, table_transformer=None, arguments_loader=None, description_loader=None, formatter_class=None, sensitive_info=None, deprecate_info=None, validator=None, **kwargs): - super(AzCliCommand, self).__init__(loader.cli_ctx, name, handler, description=description, - table_transformer=table_transformer, arguments_loader=arguments_loader, - description_loader=description_loader, formatter_class=formatter_class, - deprecate_info=deprecate_info, validator=validator, **kwargs) + super().__init__(loader.cli_ctx, name, handler, description=description, + table_transformer=table_transformer, arguments_loader=arguments_loader, + description_loader=description_loader, formatter_class=formatter_class, + deprecate_info=deprecate_info, validator=validator, **kwargs) self.loader = loader self.command_source = None self.sensitive_info = sensitive_info @@ -299,7 +299,7 @@ def _resolve_default_value_from_config_file(self, arg, overrides): # same blunt mechanism like we handled id-parts, for create command, no name default if not (self.name.split()[-1] == 'create' and overrides.settings.get('metavar', None) == 'NAME'): - super(AzCliCommand, self)._resolve_default_value_from_config_file(arg, overrides) + super()._resolve_default_value_from_config_file(arg, overrides) self._resolve_default_value_from_local_context(arg, overrides) @@ -318,7 +318,7 @@ def _resolve_default_value_from_local_context(self, arg, overrides): overrides.settings['default_value_source'] = 'Local Context' def load_arguments(self): - super(AzCliCommand, self).load_arguments() + super().load_arguments() if self.arguments_loader: cmd_args = self.arguments_loader() if self.supports_no_wait or self.no_wait_param: @@ -1089,7 +1089,7 @@ def __call__(self, result): if isinstance(result, poller_classes()): # most deployment operations return a poller - result = super(DeploymentOutputLongRunningOperation, self).__call__(result) + result = super().__call__(result) outputs = None try: if isinstance(result, str) and result: @@ -1151,7 +1151,7 @@ class ExtensionCommandSource: """ Class for commands contributed by an extension """ def __init__(self, overrides_command=False, extension_name=None, preview=False, experimental=False): - super(ExtensionCommandSource, self).__init__() + super().__init__() # True if the command overrides a CLI command self.overrides_command = overrides_command self.extension_name = extension_name @@ -1257,8 +1257,8 @@ def __init__(self, command_loader, group_name, **kwargs): """ merged_kwargs = self._merge_kwargs(kwargs, base_kwargs=command_loader.module_kwargs) operations_tmpl = merged_kwargs.pop('operations_tmpl', None) - super(AzCommandGroup, self).__init__(command_loader, group_name, - operations_tmpl, **merged_kwargs) + super().__init__(command_loader, group_name, + operations_tmpl, **merged_kwargs) self.group_kwargs = merged_kwargs if operations_tmpl: self.group_kwargs['operations_tmpl'] = operations_tmpl diff --git a/src/azure-cli-core/azure/cli/core/commands/command_operation.py b/src/azure-cli-core/azure/cli/core/commands/command_operation.py index c140fa4be9b..8e879afc957 100644 --- a/src/azure-cli-core/azure/cli/core/commands/command_operation.py +++ b/src/azure-cli-core/azure/cli/core/commands/command_operation.py @@ -97,7 +97,7 @@ class CommandOperation(BaseCommandOperation): def __init__(self, command_loader, op_path, **merged_kwargs): if not isinstance(op_path, str): raise TypeError("Operation must be a string. Got '{}'".format(op_path)) - super(CommandOperation, self).__init__(command_loader, **merged_kwargs) + super().__init__(command_loader, **merged_kwargs) self.op_path = op_path def handler(self, command_args): @@ -150,7 +150,7 @@ def __init__(self, command_loader, getter_op_path, setter_op_path, setter_arg_na raise TypeError("Setter operation must be a string. Got '{}'".format(setter_op_path)) if custom_function_op_path and not isinstance(custom_function_op_path, str): raise TypeError("Custom function operation must be a string. Got '{}'".format(custom_function_op_path)) - super(GenericUpdateCommandOperation, self).__init__(command_loader, **merged_kwargs) + super().__init__(command_loader, **merged_kwargs) self.getter_op_path = getter_op_path self.setter_op_path = setter_op_path @@ -334,7 +334,7 @@ class ShowCommandOperation(BaseCommandOperation): def __init__(self, command_loader, op_path, **merged_kwargs): if not isinstance(op_path, str): raise TypeError("operation must be a string. Got '{}'".format(op_path)) - super(ShowCommandOperation, self).__init__(command_loader, **merged_kwargs) + super().__init__(command_loader, **merged_kwargs) self.op_path = op_path def handler(self, command_args): @@ -377,7 +377,7 @@ class WaitCommandOperation(BaseCommandOperation): def __init__(self, command_loader, op_path, **merged_kwargs): if not isinstance(op_path, str): raise TypeError("operation must be a string. Got '{}'".format(op_path)) - super(WaitCommandOperation, self).__init__(command_loader, **merged_kwargs) + super().__init__(command_loader, **merged_kwargs) self.op_path = op_path def handler(self, command_args): # pylint: disable=too-many-statements, too-many-locals diff --git a/src/azure-cli-core/azure/cli/core/commands/parameters.py b/src/azure-cli-core/azure/cli/core/commands/parameters.py index 163470320de..7fd99b7419f 100644 --- a/src/azure-cli-core/azure/cli/core/commands/parameters.py +++ b/src/azure-cli-core/azure/cli/core/commands/parameters.py @@ -335,7 +335,7 @@ class AzArgumentContext(ArgumentsContext): def __init__(self, command_loader, scope, **kwargs): from azure.cli.core.commands import _merge_kwargs as merge_kwargs - super(AzArgumentContext, self).__init__(command_loader, scope) + super().__init__(command_loader, scope) self.scope = scope # this is called "command" in knack, but that is not an accurate name self.group_kwargs = merge_kwargs(kwargs, command_loader.module_kwargs, CLI_PARAM_KWARGS) @@ -363,7 +363,7 @@ def _ignore_if_not_registered(self, dest): arg_registry = self.command_loader.argument_registry match = arg_registry.arguments[scope].get(dest, {}) if not match: - super(AzArgumentContext, self).argument(dest, arg_type=ignore_type) + super().argument(dest, arg_type=ignore_type) # pylint: disable=arguments-differ def argument(self, dest, arg_type=None, **kwargs): @@ -384,7 +384,7 @@ def argument(self, dest, arg_type=None, **kwargs): min_api=min_api, max_api=max_api, operation_group=operation_group): - super(AzArgumentContext, self).argument(dest, **merged_kwargs) + super().argument(dest, **merged_kwargs) else: self._ignore_if_not_registered(dest) @@ -405,7 +405,7 @@ def positional(self, dest, arg_type=None, **kwargs): min_api=min_api, max_api=max_api, operation_group=operation_group): - super(AzArgumentContext, self).positional(dest, **merged_kwargs) + super().positional(dest, **merged_kwargs) else: self._ignore_if_not_registered(dest) @@ -473,7 +473,7 @@ def ignore(self, *args): return for arg in args: - super(AzArgumentContext, self).ignore(arg) + super().ignore(arg) def extra(self, dest, arg_type=None, **kwargs): diff --git a/src/azure-cli-core/azure/cli/core/commands/progress.py b/src/azure-cli-core/azure/cli/core/commands/progress.py index 885c80667f4..bc2dd8a1d66 100644 --- a/src/azure-cli-core/azure/cli/core/commands/progress.py +++ b/src/azure-cli-core/azure/cli/core/commands/progress.py @@ -105,7 +105,7 @@ def is_running(self): class IndeterminateStandardOut(ProgressViewBase): """ custom output for progress reporting """ def __init__(self, out=None, spinner=None): - super(IndeterminateStandardOut, self).__init__( + super().__init__( out if out else sys.stderr) self.spinner = spinner @@ -144,7 +144,7 @@ def _format_value(msg, percent): class DeterminateStandardOut(ProgressViewBase): """ custom output for progress reporting """ def __init__(self, out=None): - super(DeterminateStandardOut, self).__init__(out if out else sys.stderr) + super().__init__(out if out else sys.stderr) def write(self, args): """ diff --git a/src/azure-cli-core/azure/cli/core/extension/__init__.py b/src/azure-cli-core/azure/cli/core/extension/__init__.py index 04e7f30bbb5..627f3fdd5c7 100644 --- a/src/azure-cli-core/azure/cli/core/extension/__init__.py +++ b/src/azure-cli-core/azure/cli/core/extension/__init__.py @@ -51,7 +51,7 @@ class ExtensionNotInstalledException(Exception): def __init__(self, extension_name): - super(ExtensionNotInstalledException, self).__init__(extension_name) + super().__init__(extension_name) self.extension_name = extension_name def __str__(self): @@ -127,7 +127,7 @@ def get_all(): class WheelExtension(Extension): def __init__(self, name, path=None): - super(WheelExtension, self).__init__(name, 'whl', path) + super().__init__(name, 'whl', path) def get_version(self): return self.metadata.get('version') @@ -207,7 +207,7 @@ def get_all(): class DevExtension(Extension): def __init__(self, name, path): - super(DevExtension, self).__init__(name, 'dev', path) + super().__init__(name, 'dev', path) def get_version(self): return self.metadata.get('version') diff --git a/src/azure-cli-core/azure/cli/core/mock.py b/src/azure-cli-core/azure/cli/core/mock.py index 7fa63bc390e..4f125a1b7ae 100644 --- a/src/azure-cli-core/azure/cli/core/mock.py +++ b/src/azure-cli-core/azure/cli/core/mock.py @@ -50,7 +50,7 @@ def __init__(self, commands_loader_cls=None, random_config_dir=False, **kwargs): except FileNotFoundError: pass - super(DummyCli, self).__init__( + super().__init__( cli_name='az', config_dir=GLOBAL_CONFIG_DIR, config_env_var_prefix=ENV_VAR_PREFIX, diff --git a/src/azure-cli-core/azure/cli/core/parser.py b/src/azure-cli-core/azure/cli/core/parser.py index 4985a39cf45..1a20b4cd8a5 100644 --- a/src/azure-cli-core/azure/cli/core/parser.py +++ b/src/azure-cli-core/azure/cli/core/parser.py @@ -54,10 +54,10 @@ def _get_completions(self, comp_words, cword_prefix, cword_prequote, last_wordbr cword_prequote=cword_prequote, last_wordbreak_pos=last_wordbreak_pos) - return external_completions + super(AzCompletionFinder, self)._get_completions(comp_words, - cword_prefix, - cword_prequote, - last_wordbreak_pos) + return external_completions + super()._get_completions(comp_words, + cword_prefix, + cword_prequote, + last_wordbreak_pos) class AzCliCommandParser(CLICommandParser): @@ -70,7 +70,7 @@ def __init__(self, cli_ctx=None, cli_help=None, **kwargs): self._suggestion_msg = [] self.subparser_map = {} self.specified_arguments = [] - super(AzCliCommandParser, self).__init__(cli_ctx, cli_help=cli_help, **kwargs) + super().__init__(cli_ctx, cli_help=cli_help, **kwargs) def load_command_table(self, command_loader): """Load a command table into our parser.""" @@ -189,7 +189,7 @@ def format_help(self): extension_name=extension_name, extension_version=extension_version) telemetry.set_success(summary='show help') - super(AzCliCommandParser, self).format_help() + super().format_help() def get_examples(self, command): if not self.cli_help: @@ -269,7 +269,7 @@ def has_extension_name(command_source): return command, self._raw_arguments, extension def _get_values(self, action, arg_strings): - value = super(AzCliCommandParser, self)._get_values(action, arg_strings) + value = super()._get_values(action, arg_strings) if action.dest and isinstance(action.dest, str) and not action.dest.startswith('_'): self.specified_arguments.append(action.dest) return value diff --git a/src/azure-cli-core/azure/cli/core/profiles/_shared.py b/src/azure-cli-core/azure/cli/core/profiles/_shared.py index beb58a20293..95a4a88fac3 100644 --- a/src/azure-cli-core/azure/cli/core/profiles/_shared.py +++ b/src/azure-cli-core/azure/cli/core/profiles/_shared.py @@ -16,7 +16,7 @@ class APIVersionException(Exception): def __init__(self, type_name, api_profile): - super(APIVersionException, self).__init__(type_name, api_profile) + super().__init__(type_name, api_profile) self.type_name = type_name self.api_profile = api_profile diff --git a/src/azure-cli-core/azure/cli/core/tests/test_application.py b/src/azure-cli-core/azure/cli/core/tests/test_application.py index 67e35138d28..4884a56e272 100644 --- a/src/azure-cli-core/azure/cli/core/tests/test_application.py +++ b/src/azure-cli-core/azure/cli/core/tests/test_application.py @@ -41,7 +41,7 @@ def _handler(args): class TestCommandsLoader(AzCommandsLoader): def load_command_table(self, args): - super(TestCommandsLoader, self).load_command_table(args) + super().load_command_table(args) self.command_table = {'test': AzCliCommand(self, 'test', _handler)} return self.command_table diff --git a/src/azure-cli-core/azure/cli/core/tests/test_breaking_change.py b/src/azure-cli-core/azure/cli/core/tests/test_breaking_change.py index 223e12eeb11..e99627a3d28 100644 --- a/src/azure-cli-core/azure/cli/core/tests/test_breaking_change.py +++ b/src/azure-cli-core/azure/cli/core/tests/test_breaking_change.py @@ -18,7 +18,7 @@ def __init__(self, cli_ctx=None, command_group_cls=None, argument_context_cls=No self.cmd_to_loader_map = {} def load_command_table(self, args): - super(TestCommandsLoader, self).load_command_table(args) + super().load_command_table(args) with self.command_group('test group', operations_tmpl='{}#TestCommandsLoader.{{}}'.format(__name__)) as g: g.command('cmd', '_test_command') self.cmd_to_loader_map['test group cmd'] = [self] @@ -26,7 +26,7 @@ def load_command_table(self, args): return self.command_table def load_arguments(self, command): - super(TestCommandsLoader, self).load_arguments(command) + super().load_arguments(command) with self.argument_context('test group cmd') as c: c.argument('arg1', options_list=('--arg1', '--arg1-alias', '-a')) c.argument('arg2', options_list=('--arg2', '--arg2-alias', '--arg2-alias-long')) diff --git a/src/azure-cli-core/azure/cli/core/tests/test_command_recommender.py b/src/azure-cli-core/azure/cli/core/tests/test_command_recommender.py index 5cb4e2d7cc8..9cee12d07bc 100644 --- a/src/azure-cli-core/azure/cli/core/tests/test_command_recommender.py +++ b/src/azure-cli-core/azure/cli/core/tests/test_command_recommender.py @@ -63,13 +63,13 @@ def _prepare_test_commands_loader(loader_cls, cli_ctx, command): class TestCommandsLoader(AzCommandsLoader): def load_command_table(self, args): - super(TestCommandsLoader, self).load_command_table(args) + super().load_command_table(args) with self.command_group('test group', operations_tmpl='{}#TestCommandRecommender.{{}}'.format(__name__)) as g: g.command('cmd', 'sample_command') return self.command_table def load_arguments(self, command): - super(TestCommandsLoader, self).load_arguments(command) + super().load_arguments(command) with self.argument_context('test group cmd') as c: c.argument('arg1', options_list=('--arg1', '--arg1-alias', '-a')) c.argument('arg2', options_list=('--arg2', '--arg2-alias', '--arg2-alias-long')) diff --git a/src/azure-cli-core/azure/cli/core/tests/test_command_registration.py b/src/azure-cli-core/azure/cli/core/tests/test_command_registration.py index 9e695839b8a..21d03d47b5e 100644 --- a/src/azure-cli-core/azure/cli/core/tests/test_command_registration.py +++ b/src/azure-cli-core/azure/cli/core/tests/test_command_registration.py @@ -69,13 +69,13 @@ def test_argument(self): class TestCommandsLoader(AzCommandsLoader): def load_command_table(self, args): - super(TestCommandsLoader, self).load_command_table(args) + super().load_command_table(args) with self.command_group('test register', operations_tmpl='{}#TestCommandRegistration.{{}}'.format(__name__)) as g: g.command('sample-vm-get', 'sample_vm_get') return self.command_table def load_arguments(self, command): - super(TestCommandsLoader, self).load_arguments(command) + super().load_arguments(command) with self.argument_context('test register sample-vm-get') as c: c.argument('vm_name', options_list=('--wonky-name', '-n'), metavar='VMNAME', help='Completely WONKY name...', required=False) @@ -102,13 +102,13 @@ def test_register_command(self): class TestCommandsLoader(AzCommandsLoader): def load_command_table(self, args): - super(TestCommandsLoader, self).load_command_table(args) + super().load_command_table(args) with self.command_group('test command', operations_tmpl='{}#TestCommandRegistration.{{}}'.format(__name__)) as g: g.command('sample-vm-get', 'sample_vm_get') return self.command_table def load_arguments(self, command): - super(TestCommandsLoader, self).load_arguments(command) + super().load_arguments(command) with self.argument_context('test register sample-vm-get') as c: c.argument('vm_name', options_list=('--wonky-name', '-n'), metavar='VMNAME', help='Completely WONKY name...', required=False) @@ -455,7 +455,7 @@ def test_argument_with_overrides(self): class TestCommandsLoader(AzCommandsLoader): def load_command_table(self, args): - super(TestCommandsLoader, self).load_command_table(args) + super().load_command_table(args) with self.command_group('test', operations_tmpl='{}#TestCommandRegistration.{{}}'.format(__name__)) as g: g.command('vm-get', 'sample_vm_get') g.command('command vm-get-1', 'sample_vm_get') @@ -463,7 +463,7 @@ def load_command_table(self, args): return self.command_table def load_arguments(self, command): - super(TestCommandsLoader, self).load_arguments(command) + super().load_arguments(command) with self.argument_context('test') as c: c.argument('vm_name', global_vm_name_type) @@ -493,13 +493,13 @@ def test_extra_argument(self): class TestCommandsLoader(AzCommandsLoader): def load_command_table(self, args): - super(TestCommandsLoader, self).load_command_table(args) + super().load_command_table(args) with self.command_group('test command', operations_tmpl='{}#TestCommandRegistration.{{}}'.format(__name__)) as g: g.command('sample-vm-get', 'sample_vm_get') return self.command_table def load_arguments(self, command): - super(TestCommandsLoader, self).load_arguments(command) + super().load_arguments(command) with self.argument_context('test command sample-vm-get') as c: c.extra('added_param', options_list=['--added-param'], metavar='ADDED', help='Just added this right now!', required=True) @@ -540,7 +540,7 @@ def sample_sdk_method_with_weird_docstring(param_a, param_b, param_c): # pylint class TestCommandsLoader(AzCommandsLoader): def load_command_table(self, args): - super(TestCommandsLoader, self).load_command_table(args) + super().load_command_table(args) with self.command_group('test command', operations_tmpl='{}#{{}}'.format(__name__)) as g: g.command('foo', sample_sdk_method_with_weird_docstring.__name__) return self.command_table @@ -596,13 +596,13 @@ def test_validator_completer(): class TestCommandsLoader(AzCommandsLoader): def load_command_table(self, args): - super(TestCommandsLoader, self).load_command_table(args) + super().load_command_table(args) with self.command_group('override_using_register_cli_argument', operations_tmpl='{}#{{}}'.format(__name__)) as g: g.command('foo', 'sample_sdk_method') return self.command_table def load_arguments(self, command): - super(TestCommandsLoader, self).load_arguments(command) + super().load_arguments(command) with self.argument_context('override_using_register_cli_argument') as c: c.argument('param_a', options_list=('--overridden', '-r'), required=False, validator=test_validator_completer, completer=test_validator_completer) diff --git a/src/azure-cli-core/azure/cli/core/tests/test_generic_update.py b/src/azure-cli-core/azure/cli/core/tests/test_generic_update.py index a1ab2733dc0..e2ca851e788 100644 --- a/src/azure-cli-core/azure/cli/core/tests/test_generic_update.py +++ b/src/azure-cli-core/azure/cli/core/tests/test_generic_update.py @@ -75,7 +75,7 @@ def _prepare_test_loader(): class GenericUpdateTestCommandsLoader(AzCommandsLoader): def load_command_table(self, args): - super(GenericUpdateTestCommandsLoader, self).load_command_table(args) + super().load_command_table(args) from azure.cli.core.commands import CliCommandType diff --git a/src/azure-cli-core/azure/cli/core/tests/test_help_loaders.py b/src/azure-cli-core/azure/cli/core/tests/test_help_loaders.py index 855c51b50d1..dc6df7f4a3d 100644 --- a/src/azure-cli-core/azure/cli/core/tests/test_help_loaders.py +++ b/src/azure-cli-core/azure/cli/core/tests/test_help_loaders.py @@ -17,8 +17,7 @@ def __init__(self, cli_ctx=None): compute_custom = CliCommandType( operations_tmpl='{}#{{}}'.format(__name__), ) - super(TestCommandLoader, self).__init__(cli_ctx=cli_ctx, - custom_command_type=compute_custom) + super().__init__(cli_ctx=cli_ctx, custom_command_type=compute_custom) self.cmd_to_loader_map = {} def load_command_table(self, args): diff --git a/src/azure-cli-core/azure/cli/core/tests/test_parser.py b/src/azure-cli-core/azure/cli/core/tests/test_parser.py index 78d27448227..bff9c8ddc62 100644 --- a/src/azure-cli-core/azure/cli/core/tests/test_parser.py +++ b/src/azure-cli-core/azure/cli/core/tests/test_parser.py @@ -160,7 +160,7 @@ def test_handler(): class TestCommandsLoader(AzCommandsLoader): def load_command_table(self, args): - super(TestCommandsLoader, self).load_command_table(args) + super().load_command_table(args) command = AzCliCommand(loader, 'test module', test_handler) command.add_argument('opt', '--opt', required=True, **enum_choice_list(TestEnum)) self.command_table['test module'] = command @@ -170,7 +170,7 @@ def load_command_table(self, args): class ExtCommandsLoader(AzCommandsLoader): def load_command_table(self, args): - super(ExtCommandsLoader, self).load_command_table(args) + super().load_command_table(args) command = AzCliCommand(loader, 'test extension', test_handler) command.add_argument('opt', '--opt', required=True, **enum_choice_list(TestEnum)) self.command_table['test extension'] = command diff --git a/src/azure-cli-core/azure/cli/core/tests/test_profile.py b/src/azure-cli-core/azure/cli/core/tests/test_profile.py index d9825916d71..425f968c083 100644 --- a/src/azure-cli-core/azure/cli/core/tests/test_profile.py +++ b/src/azure-cli-core/azure/cli/core/tests/test_profile.py @@ -1502,8 +1502,7 @@ def __init__(self, id, display_name, state, tenant_id, managed_by_tenants=[], ho policies = SubscriptionPolicies() policies.spending_limit = SpendingLimit.current_period_off policies.quota_id = 'some quota' - super(SubscriptionStub, self).__init__(subscription_policies=policies, - authorization_source='some_authorization_source') + super().__init__(subscription_policies=policies, authorization_source='some_authorization_source') self.id = id self.subscription_id = id.split('/')[1] self.display_name = display_name diff --git a/src/azure-cli-telemetry/azure/cli/telemetry/components/telemetry_client.py b/src/azure-cli-telemetry/azure/cli/telemetry/components/telemetry_client.py index 043de4e6a73..84775f21763 100644 --- a/src/azure-cli-telemetry/azure/cli/telemetry/components/telemetry_client.py +++ b/src/azure-cli-telemetry/azure/cli/telemetry/components/telemetry_client.py @@ -93,7 +93,7 @@ class _NoRetrySender(SynchronousSender): def __init__(self): from azure.cli.telemetry.components.telemetry_logging import get_logger - super(_NoRetrySender, self).__init__() + super().__init__() self._logger = get_logger('sender') def send(self, data_to_send): diff --git a/src/azure-cli-telemetry/azure/cli/telemetry/components/telemetry_note.py b/src/azure-cli-telemetry/azure/cli/telemetry/components/telemetry_note.py index ed461b6214b..f3e9edf1362 100644 --- a/src/azure-cli-telemetry/azure/cli/telemetry/components/telemetry_note.py +++ b/src/azure-cli-telemetry/azure/cli/telemetry/components/telemetry_note.py @@ -18,9 +18,9 @@ def __init__(self, config_dir): self._logger = get_logger('note') if not os.path.exists(self._path): - super(TelemetryNote, self).__init__(self._path, mode='w', timeout=0.1, fail_when_locked=True) + super().__init__(self._path, mode='w', timeout=0.1, fail_when_locked=True) else: - super(TelemetryNote, self).__init__(self._path, mode='r+', timeout=1, fail_when_locked=True) + super().__init__(self._path, mode='r+', timeout=1, fail_when_locked=True) @staticmethod def get_file_path(config_dir): diff --git a/src/azure-cli-telemetry/azure/cli/telemetry/tests/test_telemetry_client.py b/src/azure-cli-telemetry/azure/cli/telemetry/tests/test_telemetry_client.py index 129827cc9bd..5a3cea73bdc 100644 --- a/src/azure-cli-telemetry/azure/cli/telemetry/tests/test_telemetry_client.py +++ b/src/azure-cli-telemetry/azure/cli/telemetry/tests/test_telemetry_client.py @@ -28,7 +28,7 @@ class _TestSender(SynchronousSender): instances = [] def __init__(self): - super(_TestSender, self).__init__() + super().__init__() _TestSender.instances.append(self) self.data = [] diff --git a/src/azure-cli-testsdk/azure/cli/testsdk/base.py b/src/azure-cli-testsdk/azure/cli/testsdk/base.py index 8dbb81f43ec..3c0d65c5cab 100644 --- a/src/azure-cli-testsdk/azure/cli/testsdk/base.py +++ b/src/azure-cli-testsdk/azure/cli/testsdk/base.py @@ -125,7 +125,7 @@ def _merge_lists(base, patches): merged = list(set(merged).union(set(patches))) return merged - super(ScenarioTest, self).__init__( + super().__init__( method_name, config_file=config_file, recording_processors=_merge_lists(default_recording_processors, recording_processors), @@ -143,7 +143,7 @@ def tearDown(self): from azure.cli.core.util import rmtree_with_retry rmtree_with_retry(self.cli_ctx.config.config_dir) self.cli_ctx.env_patch.stop() - super(ScenarioTest, self).tearDown() + super().tearDown() def create_random_name(self, prefix, length): self.test_resources_count += 1 @@ -186,9 +186,9 @@ def get_subscription_id(self): class LocalContextScenarioTest(ScenarioTest): def __init__(self, method_name, config_file=None, recording_name=None, recording_processors=None, replay_processors=None, recording_patches=None, replay_patches=None, working_dir=None): - super(LocalContextScenarioTest, self).__init__(method_name, config_file, recording_name, recording_processors, - replay_processors, recording_patches, replay_patches, - random_config_dir=True) + super().__init__(method_name, config_file, recording_name, recording_processors, + replay_processors, recording_patches, replay_patches, + random_config_dir=True) if self.in_recording: self.recording_patches.append(patch_get_current_system_username) else: @@ -200,13 +200,13 @@ def __init__(self, method_name, config_file=None, recording_name=None, recording self.working_dir = tempfile.mkdtemp() def setUp(self): - super(LocalContextScenarioTest, self).setUp() + super().setUp() self.cli_ctx.local_context.initialize() os.chdir(self.working_dir) self.cmd('config param-persist on') def tearDown(self): - super(LocalContextScenarioTest, self).tearDown() + super().tearDown() self.cmd('config param-persist off') self.cmd('config param-persist delete --all --purge -y') os.chdir(self.original_working_dir) @@ -219,7 +219,7 @@ def tearDown(self): class LiveScenarioTest(IntegrationTestBase, CheckerMixin, unittest.TestCase): def __init__(self, method_name): - super(LiveScenarioTest, self).__init__(method_name) + super().__init__(method_name) self.cli_ctx = get_dummy_cli() self.kwargs = {} self.test_resources_count = 0 diff --git a/src/azure-cli-testsdk/azure/cli/testsdk/exceptions.py b/src/azure-cli-testsdk/azure/cli/testsdk/exceptions.py index f490a6d8e4f..4cbea3ddeed 100644 --- a/src/azure-cli-testsdk/azure/cli/testsdk/exceptions.py +++ b/src/azure-cli-testsdk/azure/cli/testsdk/exceptions.py @@ -7,19 +7,18 @@ class CliTestError(Exception): def __init__(self, error_message): message = 'An error caused by the CLI test harness failed the test: {}' - super(CliTestError, self).__init__(message.format(error_message)) + super().__init__(message.format(error_message)) class CliExecutionError(Exception): def __init__(self, exception): self.exception = exception message = 'The CLI throws exception {} during execution and fails the command.' - super(CliExecutionError, self).__init__(message.format(exception.__class__.__name__, - exception)) + super().__init__(message.format(exception.__class__.__name__, exception)) class JMESPathCheckAssertionError(AssertionError): def __init__(self, query, expected, actual, json_data): message = "Query '{}' doesn't yield expected value '{}', instead the actual value " \ "is '{}'. Data: \n{}\n".format(query, expected, actual, json_data) - super(JMESPathCheckAssertionError, self).__init__(message) + super().__init__(message) diff --git a/src/azure-cli-testsdk/azure/cli/testsdk/preparers.py b/src/azure-cli-testsdk/azure/cli/testsdk/preparers.py index 926923a63eb..ebe331d0156 100644 --- a/src/azure-cli-testsdk/azure/cli/testsdk/preparers.py +++ b/src/azure-cli-testsdk/azure/cli/testsdk/preparers.py @@ -25,7 +25,7 @@ class NoTrafficRecordingPreparer(AbstractPreparer): from .base import execute as _raw_execute def __init__(self, *args, **kwargs): - super(NoTrafficRecordingPreparer, self).__init__(disable_recording=True, *args, **kwargs) + super().__init__(disable_recording=True, *args, **kwargs) def live_only_execute(self, cli_ctx, command, expect_failure=False): # call AbstractPreparer.moniker to make resource counts and self.resource_moniker consistent between live and @@ -56,7 +56,7 @@ def __init__(self, name_prefix='clitest.rg', random_name_length=75, key='rg', subscription=None, additional_tags=None): if ' ' in name_prefix: raise CliTestError('Error: Space character in resource group name prefix \'%s\'' % name_prefix) - super(ResourceGroupPreparer, self).__init__(name_prefix, random_name_length) + super().__init__(name_prefix, random_name_length) self.cli_ctx = get_dummy_cli() self.location = location self.subscription = subscription @@ -118,7 +118,7 @@ def __init__(self, name_prefix='clitest', sku='Standard_LRS', location='westus', allow_blob_public_access=False, allow_shared_key_access=None, hns=False, length=24, parameter_name='storage_account', resource_group_parameter_name='resource_group', skip_delete=True, dev_setting_name='AZURE_CLI_TEST_DEV_STORAGE_ACCOUNT_NAME', key='sa'): - super(StorageAccountPreparer, self).__init__(name_prefix, length) + super().__init__(name_prefix, length) self.cli_ctx = get_dummy_cli() self.location = location self.sku = sku @@ -186,7 +186,7 @@ def __init__(self, name_prefix='clitest', sku='standard', location='westus', parameter_name='key_vault', resource_group_parameter_name='resource_group', skip_delete=False, skip_purge=False, dev_setting_name='AZURE_CLI_TEST_DEV_KEY_VAULT_NAME', key='kv', name_len=24, additional_params=None): - super(KeyVaultPreparer, self).__init__(name_prefix, name_len) + super().__init__(name_prefix, name_len) self.cli_ctx = get_dummy_cli() self.location = location self.sku = sku @@ -242,7 +242,7 @@ class ManagedHSMPreparer(NoTrafficRecordingPreparer, SingleValueReplacer): def __init__(self, certs_path, name_prefix='clitest', location='uksouth', key='hsm', name_len=24, parameter_name='managed_hsm', resource_group_parameter_name='resource_group', administrators=None, roles=[], additional_params=None, skip_delete=False, skip_purge=False): - super(ManagedHSMPreparer, self).__init__(name_prefix, name_len) + super().__init__(name_prefix, name_len) self.cli_ctx = get_dummy_cli() self.location = location self.resource_group_parameter_name = resource_group_parameter_name @@ -320,7 +320,7 @@ def __init__(self, name_prefix='clitest', skip_assignment=True, parameter_name='sp_name', parameter_password='sp_password', dev_setting_sp_name='AZURE_CLI_TEST_DEV_SP_NAME', dev_setting_sp_password='AZURE_CLI_TEST_DEV_SP_PASSWORD', key='sp'): - super(RoleBasedServicePrincipalPreparer, self).__init__(name_prefix, 24) + super().__init__(name_prefix, 24) self.cli_ctx = get_dummy_cli() self.skip_assignment = skip_assignment self.result = {} @@ -365,7 +365,7 @@ def __init__(self, name_prefix='clitest', parameter_name='aad_client_app_id', parameter_secret='aad_client_app_secret', app_name='app_name', dev_setting_app_name='AZURE_CLI_TEST_DEV_APP_NAME', dev_setting_app_secret='AZURE_CLI_TEST_DEV_APP_SECRET', key='app'): - super(ManagedApplicationPreparer, self).__init__(name_prefix, 24) + super().__init__(name_prefix, 24) self.cli_ctx = get_dummy_cli() self.parameter_name = parameter_name self.parameter_secret = parameter_secret @@ -403,7 +403,7 @@ def __init__(self, name_prefix='clitest.vn', location='westus', if ' ' in name_prefix: raise CliTestError( 'Error: Space character in name prefix \'%s\'' % name_prefix) - super(VirtualNetworkPreparer, self).__init__( + super().__init__( name_prefix, random_name_length) self.cli_ctx = get_dummy_cli() self.location = location @@ -461,7 +461,7 @@ def __init__(self, name_prefix='clitest.nic', if ' ' in name_prefix: raise CliTestError( 'Error: Space character in name prefix \'%s\'' % name_prefix) - super(VnetNicPreparer, self).__init__(name_prefix, 15) + super().__init__(name_prefix, 15) self.cli_ctx = get_dummy_cli() self.parameter_name = parameter_name self.key = key @@ -507,7 +507,7 @@ def _get_virtual_network(self, **kwargs): class LogAnalyticsWorkspacePreparer(NoTrafficRecordingPreparer, SingleValueReplacer): def __init__(self, name_prefix='laworkspace', location='eastus2euap', parameter_name='laworkspace', resource_group_parameter_name='resource_group', skip_delete=False, get_shared_key=False): - super(LogAnalyticsWorkspacePreparer, self).__init__(name_prefix, 15) + super().__init__(name_prefix, 15) self.cli_ctx = get_dummy_cli() self.location = location self.parameter_name = parameter_name diff --git a/src/azure-cli-testsdk/azure/cli/testsdk/scenario_tests/base.py b/src/azure-cli-testsdk/azure/cli/testsdk/scenario_tests/base.py index 356dd5bbef2..ef1c5a79ff2 100644 --- a/src/azure-cli-testsdk/azure/cli/testsdk/scenario_tests/base.py +++ b/src/azure-cli-testsdk/azure/cli/testsdk/scenario_tests/base.py @@ -22,7 +22,7 @@ class IntegrationTestBase(unittest.TestCase): def __init__(self, method_name): - super(IntegrationTestBase, self).__init__(method_name) + super().__init__(method_name) self.diagnose = os.environ.get(ENV_TEST_DIAGNOSE, None) == 'True' self.logger = logging.getLogger('azure.cli.testsdk.scenario_tests') @@ -92,7 +92,7 @@ class ReplayableTest(IntegrationTestBase): # pylint: disable=too-many-instance- def __init__(self, # pylint: disable=too-many-arguments method_name, config_file=None, recording_dir=None, recording_name=None, recording_processors=None, replay_processors=None, recording_patches=None, replay_patches=None): - super(ReplayableTest, self).__init__(method_name) + super().__init__(method_name) self.recording_processors = recording_processors or [] # Processors that will be called when all self.recording_processors finishes @@ -134,7 +134,7 @@ def __init__(self, # pylint: disable=too-many-arguments self.original_env = os.environ.copy() def setUp(self): - super(ReplayableTest, self).setUp() + super().setUp() # set up cassette cm = self.vcr.use_cassette(self.temp_recording_file if self.in_recording else self.recording_file) diff --git a/src/azure-cli-testsdk/azure/cli/testsdk/scenario_tests/exceptions.py b/src/azure-cli-testsdk/azure/cli/testsdk/scenario_tests/exceptions.py index bdebae0b44e..f0cb2e5a9df 100644 --- a/src/azure-cli-testsdk/azure/cli/testsdk/scenario_tests/exceptions.py +++ b/src/azure-cli-testsdk/azure/cli/testsdk/scenario_tests/exceptions.py @@ -7,4 +7,4 @@ class AzureTestError(Exception): def __init__(self, error_message): message = 'An error caused by the Azure test harness failed the test: {}' - super(AzureTestError, self).__init__(message.format(error_message)) + super().__init__(message.format(error_message)) diff --git a/src/azure-cli-testsdk/azure/cli/testsdk/scenario_tests/tests/test_integration_test_base.py b/src/azure-cli-testsdk/azure/cli/testsdk/scenario_tests/tests/test_integration_test_base.py index ef9e6549b65..dd03af38415 100644 --- a/src/azure-cli-testsdk/azure/cli/testsdk/scenario_tests/tests/test_integration_test_base.py +++ b/src/azure-cli-testsdk/azure/cli/testsdk/scenario_tests/tests/test_integration_test_base.py @@ -13,7 +13,7 @@ class TestIntegrationTestBase(unittest.TestCase): def test_integration_test_default_constructor(self): class MockTest(IntegrationTestBase): def __init__(self): - super(MockTest, self).__init__('sample_test') + super().__init__('sample_test') def sample_test(self): pass @@ -59,7 +59,7 @@ def sample_test(self): def test_live_test_default_constructor(self): class MockTest(LiveTest): def __init__(self): - super(MockTest, self).__init__('sample_test') + super().__init__('sample_test') def sample_test(self): pass diff --git a/src/azure-cli-testsdk/azure/cli/testsdk/scenario_tests/tests/test_preparer_order.py b/src/azure-cli-testsdk/azure/cli/testsdk/scenario_tests/tests/test_preparer_order.py index 581d21f220d..01ebdb9e823 100644 --- a/src/azure-cli-testsdk/azure/cli/testsdk/scenario_tests/tests/test_preparer_order.py +++ b/src/azure-cli-testsdk/azure/cli/testsdk/scenario_tests/tests/test_preparer_order.py @@ -11,7 +11,7 @@ class _TestPreparer(AbstractPreparer): def __init__(self, name): - super(_TestPreparer, self).__init__('test', 20) + super().__init__('test', 20) self._name = name def create_resource(self, name, **kwargs): diff --git a/src/azure-cli/azure/cli/command_modules/acr/__init__.py b/src/azure-cli/azure/cli/command_modules/acr/__init__.py index a91fd4873b0..d1f80922b02 100644 --- a/src/azure-cli/azure/cli/command_modules/acr/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/acr/__init__.py @@ -12,9 +12,9 @@ class ACRCommandsLoader(AzCommandsLoader): def __init__(self, cli_ctx=None): from azure.cli.core.profiles import ResourceType - super(ACRCommandsLoader, self).__init__(cli_ctx=cli_ctx, - resource_type=ResourceType.MGMT_CONTAINERREGISTRY, - operation_group='webhooks') + super().__init__(cli_ctx=cli_ctx, + resource_type=ResourceType.MGMT_CONTAINERREGISTRY, + operation_group='webhooks') def load_command_table(self, args): from azure.cli.command_modules.acr.commands import load_command_table diff --git a/src/azure-cli/azure/cli/command_modules/acr/_docker_utils.py b/src/azure-cli/azure/cli/command_modules/acr/_docker_utils.py index f8fa8d6339e..8fd784f039b 100644 --- a/src/azure-cli/azure/cli/command_modules/acr/_docker_utils.py +++ b/src/azure-cli/azure/cli/command_modules/acr/_docker_utils.py @@ -713,7 +713,7 @@ def parse_error_message(error_message, response): class RegistryException(CLIError): def __init__(self, message, status_code): - super(RegistryException, self).__init__(message) + super().__init__(message) self.status_code = status_code diff --git a/src/azure-cli/azure/cli/command_modules/acr/network_rule.py b/src/azure-cli/azure/cli/command_modules/acr/network_rule.py index 51084250d2b..bbf58143fd9 100644 --- a/src/azure-cli/azure/cli/command_modules/acr/network_rule.py +++ b/src/azure-cli/azure/cli/command_modules/acr/network_rule.py @@ -45,7 +45,7 @@ def __init__( providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}.' :paramtype virtual_network_resource_id: str """ - super(VirtualNetworkRule, self).__init__(**kwargs) + super().__init__(**kwargs) self.action = action self.virtual_network_resource_id = virtual_network_resource_id diff --git a/src/azure-cli/azure/cli/command_modules/acs/__init__.py b/src/azure-cli/azure/cli/command_modules/acs/__init__.py index 2891f78d5e1..f080095421a 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/acs/__init__.py @@ -15,9 +15,9 @@ def __init__(self, cli_ctx=None): from azure.cli.core.commands import CliCommandType from azure.cli.core.profiles import ResourceType acs_custom = CliCommandType(operations_tmpl='azure.cli.command_modules.acs.custom#{}') - super(ContainerServiceCommandsLoader, self).__init__(cli_ctx=cli_ctx, - custom_command_type=acs_custom, - resource_type=ResourceType.MGMT_CONTAINERSERVICE) + super().__init__(cli_ctx=cli_ctx, + custom_command_type=acs_custom, + resource_type=ResourceType.MGMT_CONTAINERSERVICE) def load_command_table(self, args): from azure.cli.command_modules.acs.commands import load_command_table diff --git a/src/azure-cli/azure/cli/command_modules/acs/tests/hybrid_2020_09_01/test_custom.py b/src/azure-cli/azure/cli/command_modules/acs/tests/hybrid_2020_09_01/test_custom.py index 1255718a7a2..d3300024526 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/tests/hybrid_2020_09_01/test_custom.py +++ b/src/azure-cli/azure/cli/command_modules/acs/tests/hybrid_2020_09_01/test_custom.py @@ -28,8 +28,8 @@ class MockCLI(CLI): def __init__(self): - super(MockCLI, self).__init__(cli_name='mock_cli', config_dir=GLOBAL_CONFIG_DIR, - config_env_var_prefix=ENV_VAR_PREFIX, commands_loader_cls=MockLoader) + super().__init__(cli_name='mock_cli', config_dir=GLOBAL_CONFIG_DIR, + config_env_var_prefix=ENV_VAR_PREFIX, commands_loader_cls=MockLoader) self.cloud = get_active_cloud(self) diff --git a/src/azure-cli/azure/cli/command_modules/acs/tests/hybrid_2020_09_01/test_validators.py b/src/azure-cli/azure/cli/command_modules/acs/tests/hybrid_2020_09_01/test_validators.py index 1444b00b42a..f74d757e952 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/tests/hybrid_2020_09_01/test_validators.py +++ b/src/azure-cli/azure/cli/command_modules/acs/tests/hybrid_2020_09_01/test_validators.py @@ -16,8 +16,8 @@ class MockCLI(CLI): def __init__(self): - super(MockCLI, self).__init__(cli_name='mock_cli', config_dir=GLOBAL_CONFIG_DIR, - config_env_var_prefix=ENV_VAR_PREFIX, commands_loader_cls=MockLoader) + super().__init__(cli_name='mock_cli', config_dir=GLOBAL_CONFIG_DIR, + config_env_var_prefix=ENV_VAR_PREFIX, commands_loader_cls=MockLoader) self.cloud = get_active_cloud(self) diff --git a/src/azure-cli/azure/cli/command_modules/acs/tests/latest/custom_preparers.py b/src/azure-cli/azure/cli/command_modules/acs/tests/latest/custom_preparers.py index f731d431fd9..f0bf07363a8 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/tests/latest/custom_preparers.py +++ b/src/azure-cli/azure/cli/command_modules/acs/tests/latest/custom_preparers.py @@ -35,7 +35,7 @@ def __init__( key="rg", preserve_default_location=False, ): - super(AKSCustomResourceGroupPreparer, self).__init__( + super().__init__( name_prefix, parameter_name, parameter_name_for_location, @@ -74,7 +74,7 @@ def __init__( random_name_length=24, key=KEY_VIRTUAL_NETWORK, ): - super(AKSCustomVirtualNetworkPreparer, self).__init__( + super().__init__( name_prefix, location, parameter_name, @@ -167,7 +167,7 @@ def __init__( dev_setting_sp_password="AZURE_CLI_TEST_DEV_SP_PASSWORD", key="sp", ): - super(AKSCustomRoleBasedServicePrincipalPreparer, self).__init__( + super().__init__( name_prefix, skip_assignment, parameter_name, @@ -180,7 +180,7 @@ def __init__( def __call__(self, fn): if not self.dev_setting_sp_password: return unittest.skip("skip test case that requires service principal as password is not provided")(fn) - return super(AKSCustomRoleBasedServicePrincipalPreparer, self).__call__(fn) + return super().__call__(fn) def create_resource(self, name, **kwargs): if not self.dev_setting_sp_password: diff --git a/src/azure-cli/azure/cli/command_modules/acs/tests/latest/mocks.py b/src/azure-cli/azure/cli/command_modules/acs/tests/latest/mocks.py index 9997ea859f9..e6210a62ecc 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/tests/latest/mocks.py +++ b/src/azure-cli/azure/cli/command_modules/acs/tests/latest/mocks.py @@ -34,7 +34,7 @@ def begin_create_or_update( class MockCLI(CLI): def __init__(self): - super(MockCLI, self).__init__( + super().__init__( cli_name="mock_cli", config_dir=MOCK_CLI_CONFIG_DIR, config_env_var_prefix=MOCK_CLI_ENV_VAR_PREFIX, diff --git a/src/azure-cli/azure/cli/command_modules/advisor/__init__.py b/src/azure-cli/azure/cli/command_modules/advisor/__init__.py index 1b430b9273b..70d537a3bf3 100644 --- a/src/azure-cli/azure/cli/command_modules/advisor/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/advisor/__init__.py @@ -14,8 +14,8 @@ def __init__(self, cli_ctx=None): from azure.cli.core.commands import CliCommandType from azure.cli.core.profiles import ResourceType advisor_custom = CliCommandType(operations_tmpl='azure.cli.command_modules.advisor.custom#{}') - super(AdvisorCommandsLoader, self).__init__(cli_ctx=cli_ctx, custom_command_type=advisor_custom, - resource_type=ResourceType.MGMT_CONTAINERSERVICE) + super().__init__(cli_ctx=cli_ctx, custom_command_type=advisor_custom, + resource_type=ResourceType.MGMT_CONTAINERSERVICE) def load_command_table(self, args): from azure.cli.command_modules.advisor.commands import load_command_table diff --git a/src/azure-cli/azure/cli/command_modules/ams/__init__.py b/src/azure-cli/azure/cli/command_modules/ams/__init__.py index 85b49ff53f3..e6229b376bf 100644 --- a/src/azure-cli/azure/cli/command_modules/ams/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/ams/__init__.py @@ -13,7 +13,7 @@ class MediaServicesCommandsLoader(AzCommandsLoader): def __init__(self, cli_ctx=None): from azure.cli.core.profiles import ResourceType - super(MediaServicesCommandsLoader, self).__init__(cli_ctx=cli_ctx, resource_type=ResourceType.MGMT_MEDIA) + super().__init__(cli_ctx=cli_ctx, resource_type=ResourceType.MGMT_MEDIA) def load_command_table(self, args): from azure.cli.command_modules.ams.commands import load_command_table diff --git a/src/azure-cli/azure/cli/command_modules/apim/__init__.py b/src/azure-cli/azure/cli/command_modules/apim/__init__.py index 955b64d08b6..495f7fb824a 100644 --- a/src/azure-cli/azure/cli/command_modules/apim/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/apim/__init__.py @@ -23,8 +23,8 @@ def __init__(self, cli_ctx=None): apim_custom = CliCommandType(operations_tmpl='azure.cli.command_modules.apim.custom#{}', client_factory=cf_apim) - super(ApimCommandsLoader, self).__init__(cli_ctx=cli_ctx, custom_command_type=apim_custom, - resource_type=ResourceType.MGMT_APIMANAGEMENT) + super().__init__(cli_ctx=cli_ctx, custom_command_type=apim_custom, + resource_type=ResourceType.MGMT_APIMANAGEMENT) def load_command_table(self, args): from azure.cli.command_modules.apim.commands import load_command_table diff --git a/src/azure-cli/azure/cli/command_modules/apim/actions.py b/src/azure-cli/azure/cli/command_modules/apim/actions.py index 143afa0c719..df07ab086d8 100644 --- a/src/azure-cli/azure/cli/command_modules/apim/actions.py +++ b/src/azure-cli/azure/cli/command_modules/apim/actions.py @@ -21,4 +21,4 @@ def __call__(self, parser, namespace, values, option_string=None): except ValueError: raise CLIError('usage error: {} KEY=VALUE [KEY=VALUE ...]'.format(option_string)) - super(TemplateParameter, self).__call__(parser, namespace, ParameterContract(**kwargs), option_string) + super().__call__(parser, namespace, ParameterContract(**kwargs), option_string) diff --git a/src/azure-cli/azure/cli/command_modules/appconfig/__init__.py b/src/azure-cli/azure/cli/command_modules/appconfig/__init__.py index 795ee532e76..33a6ebfd393 100644 --- a/src/azure-cli/azure/cli/command_modules/appconfig/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/appconfig/__init__.py @@ -15,7 +15,7 @@ def __init__(self, cli_ctx=None): from azure.cli.core import ModExtensionSuppress configstore_custom = CliCommandType( operations_tmpl='azure.cli.command_modules.appconfig.custom#{}') - super(AppconfigCommandsLoader, self).__init__( + super().__init__( cli_ctx=cli_ctx, suppress_extension=ModExtensionSuppress(__name__, 'appconfig', '0.5.0', reason='These commands are now in the CLI.', diff --git a/src/azure-cli/azure/cli/command_modules/appconfig/tests/latest/test_appconfig_commands.py b/src/azure-cli/azure/cli/command_modules/appconfig/tests/latest/test_appconfig_commands.py index af1c664e256..c6c270dcfb6 100644 --- a/src/azure-cli/azure/cli/command_modules/appconfig/tests/latest/test_appconfig_commands.py +++ b/src/azure-cli/azure/cli/command_modules/appconfig/tests/latest/test_appconfig_commands.py @@ -29,7 +29,7 @@ class AppConfigMgmtScenarioTest(ScenarioTest): def __init__(self, *args, **kwargs): kwargs["recording_processors"] = kwargs.get("recording_processors", []) + [CredentialResponseSanitizer()] - super(AppConfigMgmtScenarioTest, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) @ResourceGroupPreparer(parameter_name_for_location='location') @AllowLargeResponse() @@ -424,7 +424,7 @@ class AppConfigCredentialScenarioTest(ScenarioTest): def __init__(self, *args, **kwargs): kwargs["recording_processors"] = kwargs.get("recording_processors", []) + [CredentialResponseSanitizer()] - super(AppConfigCredentialScenarioTest, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) @AllowLargeResponse() @ResourceGroupPreparer(parameter_name_for_location='location') @@ -461,7 +461,7 @@ class AppConfigIdentityScenarioTest(ScenarioTest): def __init__(self, *args, **kwargs): kwargs["recording_processors"] = kwargs.get("recording_processors", []) + [CredentialResponseSanitizer()] - super(AppConfigIdentityScenarioTest, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) @ResourceGroupPreparer(parameter_name_for_location='location') def test_azconfig_identity(self, resource_group, location): @@ -505,7 +505,7 @@ class AppConfigKVScenarioTest(ScenarioTest): def __init__(self, *args, **kwargs): kwargs["recording_processors"] = kwargs.get("recording_processors", []) + [CredentialResponseSanitizer()] - super(AppConfigKVScenarioTest, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) @AllowLargeResponse() @ResourceGroupPreparer(parameter_name_for_location='location') @@ -822,7 +822,7 @@ class AppConfigImportExportScenarioTest(ScenarioTest): def __init__(self, *args, **kwargs): kwargs["recording_processors"] = kwargs.get("recording_processors", []) + [CredentialResponseSanitizer()] - super(AppConfigImportExportScenarioTest, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) @AllowLargeResponse() @ResourceGroupPreparer(parameter_name_for_location='location') @@ -1437,7 +1437,7 @@ class AppConfigImportExportNamingConventionScenarioTest(ScenarioTest): def __init__(self, *args, **kwargs): kwargs["recording_processors"] = kwargs.get("recording_processors", []) + [CredentialResponseSanitizer()] - super(AppConfigImportExportNamingConventionScenarioTest, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) @AllowLargeResponse() @ResourceGroupPreparer(parameter_name_for_location='location') @@ -1547,7 +1547,7 @@ class AppConfigToAppConfigImportExportScenarioTest(ScenarioTest): def __init__(self, *args, **kwargs): kwargs["recording_processors"] = kwargs.get("recording_processors", []) + [CredentialResponseSanitizer()] - super(AppConfigToAppConfigImportExportScenarioTest, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) @AllowLargeResponse() @ResourceGroupPreparer(parameter_name_for_location='location') @@ -1748,7 +1748,7 @@ class AppConfigJsonContentTypeScenarioTest(ScenarioTest): def __init__(self, *args, **kwargs): kwargs["recording_processors"] = kwargs.get("recording_processors", []) + [CredentialResponseSanitizer()] - super(AppConfigJsonContentTypeScenarioTest, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) @AllowLargeResponse() @ResourceGroupPreparer(parameter_name_for_location='location') @@ -2180,7 +2180,7 @@ class AppConfigFeatureScenarioTest(ScenarioTest): def __init__(self, *args, **kwargs): kwargs["recording_processors"] = kwargs.get("recording_processors", []) + [CredentialResponseSanitizer()] - super(AppConfigFeatureScenarioTest, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) @AllowLargeResponse() @ResourceGroupPreparer(parameter_name_for_location='location') @@ -2597,7 +2597,7 @@ class AppConfigFeatureFilterScenarioTest(ScenarioTest): def __init__(self, *args, **kwargs): kwargs["recording_processors"] = kwargs.get("recording_processors", []) + [CredentialResponseSanitizer()] - super(AppConfigFeatureFilterScenarioTest, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) @AllowLargeResponse() @ResourceGroupPreparer(parameter_name_for_location='location') @@ -2855,7 +2855,7 @@ class AppConfigKeyValidationScenarioTest(ScenarioTest): def __init__(self, *args, **kwargs): kwargs["recording_processors"] = kwargs.get("recording_processors", []) + [CredentialResponseSanitizer()] - super(AppConfigKeyValidationScenarioTest, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) @AllowLargeResponse() @ResourceGroupPreparer(parameter_name_for_location='location') @@ -2946,7 +2946,7 @@ class AppConfigAadAuthLiveScenarioTest(ScenarioTest): def __init__(self, *args, **kwargs): kwargs["recording_processors"] = kwargs.get("recording_processors", []) + [CredentialResponseSanitizer()] - super(AppConfigAadAuthLiveScenarioTest, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) @live_only() @AllowLargeResponse() @@ -3108,7 +3108,7 @@ class AppconfigReplicaLiveScenarioTest(ScenarioTest): def __init__(self, *args, **kwargs): kwargs["recording_processors"] = kwargs.get("recording_processors", []) + [CredentialResponseSanitizer()] - super(AppconfigReplicaLiveScenarioTest, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) @ResourceGroupPreparer(parameter_name_for_location='location') @AllowLargeResponse() @@ -3180,7 +3180,7 @@ class AppConfigSnapshotLiveScenarioTest(ScenarioTest): def __init__(self, *args, **kwargs): kwargs["recording_processors"] = kwargs.get("recording_processors", []) + [CredentialResponseSanitizer()] - super(AppConfigSnapshotLiveScenarioTest, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) @ResourceGroupPreparer(parameter_name_for_location='location') diff --git a/src/azure-cli/azure/cli/command_modules/appservice/__init__.py b/src/azure-cli/azure/cli/command_modules/appservice/__init__.py index b64c2e15527..46b3e8b198f 100644 --- a/src/azure-cli/azure/cli/command_modules/appservice/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/appservice/__init__.py @@ -15,9 +15,9 @@ def __init__(self, cli_ctx=None): from azure.cli.core.commands import CliCommandType from azure.cli.core.profiles import ResourceType appservice_custom = CliCommandType(operations_tmpl='azure.cli.command_modules.appservice.custom#{}') - super(AppserviceCommandsLoader, self).__init__(cli_ctx=cli_ctx, - custom_command_type=appservice_custom, - resource_type=ResourceType.MGMT_APPSERVICE) + super().__init__(cli_ctx=cli_ctx, + custom_command_type=appservice_custom, + resource_type=ResourceType.MGMT_APPSERVICE) def load_command_table(self, args): from azure.cli.command_modules.appservice.commands import load_command_table diff --git a/src/azure-cli/azure/cli/command_modules/appservice/tunnel.py b/src/azure-cli/azure/cli/command_modules/appservice/tunnel.py index bc9c9d774cd..f4059075416 100644 --- a/src/azure-cli/azure/cli/command_modules/appservice/tunnel.py +++ b/src/azure-cli/azure/cli/command_modules/appservice/tunnel.py @@ -27,12 +27,12 @@ class TunnelWebSocket(WebSocket): def recv_frame(self): - frame = super(TunnelWebSocket, self).recv_frame() + frame = super().recv_frame() logger.info('Received frame: %s', frame) return frame def recv(self): - data = super(TunnelWebSocket, self).recv() + data = super().recv() logger.info('Received websocket data: %s', data) return data diff --git a/src/azure-cli/azure/cli/command_modules/aro/tests/latest/custom_preparers.py b/src/azure-cli/azure/cli/command_modules/aro/tests/latest/custom_preparers.py index a180d175987..4de4ffa5e73 100644 --- a/src/azure-cli/azure/cli/command_modules/aro/tests/latest/custom_preparers.py +++ b/src/azure-cli/azure/cli/command_modules/aro/tests/latest/custom_preparers.py @@ -23,7 +23,7 @@ def __init__( dev_setting_sp_password="AZURE_CLI_TEST_DEV_SP_PASSWORD", key="aro_csp", ): - super(AROClusterServicePrincipalPreparer, self).__init__( + super().__init__( name_prefix, skip_assignment, parameter_name, diff --git a/src/azure-cli/azure/cli/command_modules/backup/__init__.py b/src/azure-cli/azure/cli/command_modules/backup/__init__.py index 8a181a0e989..97ace095138 100644 --- a/src/azure-cli/azure/cli/command_modules/backup/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/backup/__init__.py @@ -14,9 +14,9 @@ def __init__(self, cli_ctx=None): from azure.cli.core.commands import CliCommandType from azure.cli.core.profiles import ResourceType backup_custom = CliCommandType(operations_tmpl='azure.cli.command_modules.backup.custom#{}') - super(BackupCommandsLoader, self).__init__(cli_ctx=cli_ctx, - resource_type=ResourceType.MGMT_BACKUP, - custom_command_type=backup_custom) + super().__init__(cli_ctx=cli_ctx, + resource_type=ResourceType.MGMT_BACKUP, + custom_command_type=backup_custom) def load_command_table(self, args): from azure.cli.command_modules.backup.commands import load_command_table diff --git a/src/azure-cli/azure/cli/command_modules/backup/tests/latest/preparers.py b/src/azure-cli/azure/cli/command_modules/backup/tests/latest/preparers.py index 5b805e529ac..ade7d8802f5 100644 --- a/src/azure-cli/azure/cli/command_modules/backup/tests/latest/preparers.py +++ b/src/azure-cli/azure/cli/command_modules/backup/tests/latest/preparers.py @@ -21,7 +21,7 @@ def __init__(self, name_prefix='clitest-vault', parameter_name='vault_name', resource_group_location_parameter_name='resource_group_location', resource_group_parameter_name='resource_group', dev_setting_name='AZURE_CLI_TEST_DEV_BACKUP_ACCT_NAME', soft_delete=True): - super(VaultPreparer, self).__init__(name_prefix, 24) + super().__init__(name_prefix, 24) from azure.cli.core.mock import DummyCli self.cli_ctx = DummyCli() self.parameter_name = parameter_name @@ -90,7 +90,7 @@ class VMPreparer(AbstractPreparer, SingleValueReplacer): def __init__(self, name_prefix='clitest-vm', parameter_name='vm_name', resource_group_location_parameter_name='resource_group_location', resource_group_parameter_name='resource_group', dev_setting_name='AZURE_CLI_TEST_DEV_BACKUP_VM_NAME'): - super(VMPreparer, self).__init__(name_prefix, 15) + super().__init__(name_prefix, 15) from azure.cli.core.mock import DummyCli self.cli_ctx = DummyCli() self.parameter_name = parameter_name @@ -143,7 +143,7 @@ def __init__(self, name_prefix='clitest-item', parameter_name='item_name', vm_pa vault_parameter_name='vault_name', resource_group_parameter_name='resource_group', dev_setting_name='AZURE_CLI_TEST_DEV_BACKUP_ITEM_NAME'): - super(ItemPreparer, self).__init__(name_prefix, 24) + super().__init__(name_prefix, 24) from azure.cli.core.mock import DummyCli self.cli_ctx = DummyCli() self.parameter_name = parameter_name @@ -201,7 +201,7 @@ class PolicyPreparer(AbstractPreparer, SingleValueReplacer): def __init__(self, name_prefix='clitest-item', parameter_name='policy_name', vault_parameter_name='vault_name', resource_group_parameter_name='resource_group', instant_rp_days=None): - super(PolicyPreparer, self).__init__(name_prefix, 24) + super().__init__(name_prefix, 24) from azure.cli.core.mock import DummyCli self.cli_ctx = DummyCli() self.parameter_name = parameter_name @@ -256,7 +256,7 @@ class RPPreparer(AbstractPreparer, SingleValueReplacer): def __init__(self, name_prefix='clitest-rp', parameter_name='rp_name', vm_parameter_name='vm_name', vault_parameter_name='vault_name', resource_group_parameter_name='resource_group', dev_setting_name='AZURE_CLI_TEST_DEV_BACKUP_RP_NAME'): - super(RPPreparer, self).__init__(name_prefix, 24) + super().__init__(name_prefix, 24) from azure.cli.core.mock import DummyCli self.cli_ctx = DummyCli() self.parameter_name = parameter_name @@ -315,7 +315,7 @@ def _get_vm(self, **kwargs): class KeyPreparer(AbstractPreparer, SingleValueReplacer): def __init__(self, name_prefix='clitest-key', parameter_name='key_url', keyvault_parameter_name='key_vault', dev_setting_name='AZURE_CLI_TEST_DEV_BACKUP_KEY_NAME'): - super(KeyPreparer, self).__init__(name_prefix, 24) + super().__init__(name_prefix, 24) from azure.cli.core.mock import DummyCli self.cli_ctx = DummyCli() self.parameter_name = parameter_name @@ -349,7 +349,7 @@ def _get_keyvault(self, **kwargs): class DESPreparer(AbstractPreparer, SingleValueReplacer): def __init__(self, name_prefix='clitest-des', parameter_name='des_name', key_parameter_name='key_url', resource_group_parameter_name='resource_group', dev_setting_name='AZURE_CLI_TEST_DEV_BACKUP_DES_NAME'): - super(DESPreparer, self).__init__(name_prefix, 24) + super().__init__(name_prefix, 24) from azure.cli.core.mock import DummyCli self.cli_ctx = DummyCli() self.resource_group = None @@ -396,7 +396,7 @@ class AFSPolicyPreparer(AbstractPreparer, SingleValueReplacer): def __init__(self, name_prefix='clitest-item', parameter_name='policy_name', vault_parameter_name='vault_name', resource_group_parameter_name='resource_group', instant_rp_days=None): - super(AFSPolicyPreparer, self).__init__(name_prefix, 24) + super().__init__(name_prefix, 24) from azure.cli.core.mock import DummyCli self.cli_ctx = DummyCli() self.parameter_name = parameter_name @@ -452,7 +452,7 @@ class FileSharePreparer(AbstractPreparer, SingleValueReplacer): def __init__(self, name_prefix='clitest-item', storage_account_parameter_name='storage_account', resource_group_parameter_name='resource_group', file_parameter_name=None, parameter_name='afs_name', file_upload=False): - super(FileSharePreparer, self).__init__(name_prefix, 24) + super().__init__(name_prefix, 24) from azure.cli.core.mock import DummyCli self.cli_ctx = DummyCli() self.parameter_name = parameter_name @@ -522,7 +522,7 @@ def __init__(self, name_prefix='clitest-item', storage_account_parameter_name='s resource_group_parameter_name='resource_group', vault_parameter_name='vault_name', parameter_name='item_name', afs_parameter_name='afs_name', policy_parameter_name='policy_name'): - super(AFSItemPreparer, self).__init__(name_prefix, 24) + super().__init__(name_prefix, 24) from azure.cli.core.mock import DummyCli self.cli_ctx = DummyCli() self.parameter_name = parameter_name @@ -640,7 +640,7 @@ class AFSRPPreparer(AbstractPreparer, SingleValueReplacer): def __init__(self, name_prefix='clitest-item', storage_account_parameter_name='storage_account', resource_group_parameter_name='resource_group', vault_parameter_name='vault_name', parameter_name='rp_name', afs_parameter_name='afs_name'): - super(AFSRPPreparer, self).__init__(name_prefix, 24) + super().__init__(name_prefix, 24) from azure.cli.core.mock import DummyCli self.cli_ctx = DummyCli() self.parameter_name = parameter_name @@ -708,7 +708,7 @@ def _get_file_share(self, **kwargs): class FilePreparer(AbstractPreparer, SingleValueReplacer): def __init__(self, name_prefix='clitest-file', parameter_name='file_name'): - super(FilePreparer, self).__init__(name_prefix, 24) + super().__init__(name_prefix, 24) self.parameter_name = parameter_name def create_resource(self, name, **kwargs): diff --git a/src/azure-cli/azure/cli/command_modules/batch/__init__.py b/src/azure-cli/azure/cli/command_modules/batch/__init__.py index acb37038a58..eff02f17f1c 100644 --- a/src/azure-cli/azure/cli/command_modules/batch/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/batch/__init__.py @@ -18,10 +18,10 @@ def __init__(self, cli_ctx=None): batch_custom = CliCommandType( operations_tmpl='azure.cli.command_modules.batch.custom#{}', exception_handler=batch_exception_handler) - super(BatchCommandsLoader, self).__init__(cli_ctx=cli_ctx, - custom_command_type=batch_custom, - command_group_cls=BatchCommandGroup, - resource_type=ResourceType.MGMT_BATCH) + super().__init__(cli_ctx=cli_ctx, + custom_command_type=batch_custom, + command_group_cls=BatchCommandGroup, + resource_type=ResourceType.MGMT_BATCH) self.module_name = __name__ def load_command_table(self, args): diff --git a/src/azure-cli/azure/cli/command_modules/batch/tests/latest/batch_preparers.py b/src/azure-cli/azure/cli/command_modules/batch/tests/latest/batch_preparers.py index 0c3418deed6..2871bbbd29e 100644 --- a/src/azure-cli/azure/cli/command_modules/batch/tests/latest/batch_preparers.py +++ b/src/azure-cli/azure/cli/command_modules/batch/tests/latest/batch_preparers.py @@ -13,7 +13,7 @@ class BatchAccountPreparer(AbstractPreparer, SingleValueReplacer): def __init__(self, name_prefix='clibatch', parameter_name='batch_account_name', location='eastus', resource_group_parameter_name='resource_group', skip_delete=True, dev_setting_name='AZURE_CLI_TEST_DEV_BATCH_ACCT_NAME'): - super(BatchAccountPreparer, self).__init__(name_prefix, 24) + super().__init__(name_prefix, 24) from azure.cli.core.mock import DummyCli self.cli_ctx = DummyCli() self.parameter_name = parameter_name diff --git a/src/azure-cli/azure/cli/command_modules/batch/tests/latest/test_batch_commands.py b/src/azure-cli/azure/cli/command_modules/batch/tests/latest/test_batch_commands.py index fe882f38473..f82dd61de6c 100644 --- a/src/azure-cli/azure/cli/command_modules/batch/tests/latest/test_batch_commands.py +++ b/src/azure-cli/azure/cli/command_modules/batch/tests/latest/test_batch_commands.py @@ -24,7 +24,7 @@ class TestBatchValidators(unittest.TestCase): # pylint: disable=protected-access def __init__(self, methodName): - super(TestBatchValidators, self).__init__(methodName) + super().__init__(methodName) def test_batch_datetime_format(self): obj = _validators.datetime_format("2017-01-24T15:47:24Z") @@ -488,7 +488,7 @@ def get_client(*_): 'azure.batch.operations._job_schedule_operations#JobScheduleOperations.add', operations._job_schedule_operations.JobScheduleOperations.add, client_factory=get_client, flatten=4) - return super(TestBatchLoader, self).setUp() + return super().setUp() def test_batch_build_parameters(self): kwargs = { diff --git a/src/azure-cli/azure/cli/command_modules/batchai/__init__.py b/src/azure-cli/azure/cli/command_modules/batchai/__init__.py index bf4d3b915b9..47a175990ac 100644 --- a/src/azure-cli/azure/cli/command_modules/batchai/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/batchai/__init__.py @@ -14,9 +14,9 @@ def __init__(self, cli_ctx=None): from azure.cli.core.commands import CliCommandType from azure.cli.core.profiles import ResourceType batchai_custom = CliCommandType(operations_tmpl='azure.cli.command_modules.batchai.custom#{}') - super(BatchAiCommandsLoader, self).__init__(cli_ctx=cli_ctx, - resource_type=ResourceType.MGMT_BATCHAI, - custom_command_type=batchai_custom) + super().__init__(cli_ctx=cli_ctx, + resource_type=ResourceType.MGMT_BATCHAI, + custom_command_type=batchai_custom) def load_command_table(self, args): from azure.cli.command_modules.batchai.commands import load_command_table diff --git a/src/azure-cli/azure/cli/command_modules/billing/__init__.py b/src/azure-cli/azure/cli/command_modules/billing/__init__.py index 7d46c1bc6ed..0650f8238ef 100644 --- a/src/azure-cli/azure/cli/command_modules/billing/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/billing/__init__.py @@ -21,8 +21,8 @@ def __init__(self, cli_ctx=None): from azure.cli.core.commands import CliCommandType from azure.cli.core.profiles import ResourceType billing_custom = CliCommandType(operations_tmpl='azure.cli.command_modules.billing.custom#{}') - super(BillingCommandsLoader, self).__init__(cli_ctx=cli_ctx, custom_command_type=billing_custom, - resource_type=ResourceType.MGMT_BILLING) + super().__init__(cli_ctx=cli_ctx, custom_command_type=billing_custom, + resource_type=ResourceType.MGMT_BILLING) def load_command_table(self, args): from azure.cli.command_modules.billing.commands import load_command_table diff --git a/src/azure-cli/azure/cli/command_modules/billing/generated/action.py b/src/azure-cli/azure/cli/command_modules/billing/generated/action.py index 99e62cb1b6b..af995a149e5 100644 --- a/src/azure-cli/azure/cli/command_modules/billing/generated/action.py +++ b/src/azure-cli/azure/cli/command_modules/billing/generated/action.py @@ -63,7 +63,7 @@ def get_action(self, values, option_string): # pylint: disable=no-self-use class AddEnabledAzurePlans(argparse._AppendAction): def __call__(self, parser, namespace, values, option_string=None): action = self.get_action(values, option_string) - super(AddEnabledAzurePlans, self).__call__(parser, namespace, action, option_string) + super().__call__(parser, namespace, action, option_string) def get_action(self, values, option_string): # pylint: disable=no-self-use try: diff --git a/src/azure-cli/azure/cli/command_modules/billing/manual/action.py b/src/azure-cli/azure/cli/command_modules/billing/manual/action.py index 2fbd5270bec..641017c75fa 100644 --- a/src/azure-cli/azure/cli/command_modules/billing/manual/action.py +++ b/src/azure-cli/azure/cli/command_modules/billing/manual/action.py @@ -67,7 +67,7 @@ def get_action(self, values, option_string): # pylint: disable=no-self-use class AddEnabledAzurePlans(argparse._AppendAction): def __call__(self, parser, namespace, values, option_string=None): action = self.get_action(values, option_string) - super(AddEnabledAzurePlans, self).__call__(parser, namespace, action, option_string) + super().__call__(parser, namespace, action, option_string) def get_action(self, values, option_string): # pylint: disable=no-self-use try: diff --git a/src/azure-cli/azure/cli/command_modules/botservice/__init__.py b/src/azure-cli/azure/cli/command_modules/botservice/__init__.py index e8c8b41d08a..babbc42dbc8 100644 --- a/src/azure-cli/azure/cli/command_modules/botservice/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/botservice/__init__.py @@ -17,16 +17,17 @@ def __init__(self, cli_ctx=None): custom_type = CliCommandType( operations_tmpl='azure.cli.command_modules.botservice.custom#{}', client_factory=get_botservice_management_client) - super(BotServiceCommandsLoader, self).__init__(cli_ctx=cli_ctx, - custom_command_type=custom_type, - resource_type=ResourceType.MGMT_BOTSERVICE, - suppress_extension=ModExtensionSuppress( - __name__, - 'botservice', - '0.4.3', - reason='These commands and functionality are now in the ' - 'core CLI.', - recommend_remove=True)) + super().__init__( + cli_ctx=cli_ctx, + custom_command_type=custom_type, + resource_type=ResourceType.MGMT_BOTSERVICE, + suppress_extension=ModExtensionSuppress( + __name__, + 'botservice', + '0.4.3', + reason='These commands and functionality are now in the core CLI.', + recommend_remove=True) + ) def load_command_table(self, args): from azure.cli.command_modules.botservice.commands import load_command_table diff --git a/src/azure-cli/azure/cli/command_modules/cdn/__init__.py b/src/azure-cli/azure/cli/command_modules/cdn/__init__.py index e786ce7833b..c975b942111 100644 --- a/src/azure-cli/azure/cli/command_modules/cdn/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/cdn/__init__.py @@ -14,9 +14,9 @@ def __init__(self, cli_ctx=None): from azure.cli.core.commands import CliCommandType from azure.cli.core.profiles import ResourceType cdn_custom = CliCommandType(operations_tmpl='azure.cli.command_modules.cdn.custom#{}') - super(CdnCommandsLoader, self).__init__(cli_ctx=cli_ctx, - resource_type=ResourceType.MGMT_CDN, - custom_command_type=cdn_custom) + super().__init__(cli_ctx=cli_ctx, + resource_type=ResourceType.MGMT_CDN, + custom_command_type=cdn_custom) def load_command_table(self, args): from azure.cli.command_modules.cdn.commands import load_command_table diff --git a/src/azure-cli/azure/cli/command_modules/cdn/_actions.py b/src/azure-cli/azure/cli/command_modules/cdn/_actions.py index 11450424ca3..4a1e1de6646 100644 --- a/src/azure-cli/azure/cli/command_modules/cdn/_actions.py +++ b/src/azure-cli/azure/cli/command_modules/cdn/_actions.py @@ -11,7 +11,7 @@ class OriginType(argparse._AppendAction): def __call__(self, parser, namespace, values, option_string=None): deep_created_origin = self.get_origin(values, option_string) - super(OriginType, self).__call__(parser, namespace, deep_created_origin, option_string) + super().__call__(parser, namespace, deep_created_origin, option_string) def get_origin(self, values, option_string): from azure.mgmt.cdn.models import DeepCreatedOrigin diff --git a/src/azure-cli/azure/cli/command_modules/cloud/__init__.py b/src/azure-cli/azure/cli/command_modules/cloud/__init__.py index 311c52ea5bf..d647bd0bfa5 100644 --- a/src/azure-cli/azure/cli/command_modules/cloud/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/cloud/__init__.py @@ -16,7 +16,7 @@ class CloudCommandsLoader(AzCommandsLoader): def __init__(self, cli_ctx=None): - super(CloudCommandsLoader, self).__init__(cli_ctx=cli_ctx) + super().__init__(cli_ctx=cli_ctx) def load_command_table(self, args): diff --git a/src/azure-cli/azure/cli/command_modules/cognitiveservices/__init__.py b/src/azure-cli/azure/cli/command_modules/cognitiveservices/__init__.py index e105e41d9da..8d3b75dab31 100644 --- a/src/azure-cli/azure/cli/command_modules/cognitiveservices/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/cognitiveservices/__init__.py @@ -18,9 +18,9 @@ def __init__(self, cli_ctx=None): custom_type = CliCommandType( operations_tmpl='azure.cli.command_modules.cognitiveservices.custom#{}', client_factory=cf_accounts) - super(CognitiveServicesCommandsLoader, self).__init__(cli_ctx=cli_ctx, - custom_command_type=custom_type, - resource_type=ResourceType.MGMT_COGNITIVESERVICES) + super().__init__(cli_ctx=cli_ctx, + custom_command_type=custom_type, + resource_type=ResourceType.MGMT_COGNITIVESERVICES) def load_command_table(self, args): from azure.cli.command_modules.cognitiveservices.commands import load_command_table diff --git a/src/azure-cli/azure/cli/command_modules/config/__init__.py b/src/azure-cli/azure/cli/command_modules/config/__init__.py index d06b78139f5..04341280e22 100644 --- a/src/azure-cli/azure/cli/command_modules/config/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/config/__init__.py @@ -11,7 +11,7 @@ class ConfigCommandsLoader(AzCommandsLoader): def __init__(self, cli_ctx=None): - super(ConfigCommandsLoader, self).__init__(cli_ctx=cli_ctx) + super().__init__(cli_ctx=cli_ctx) def load_command_table(self, args): from azure.cli.command_modules.config.commands import load_command_table diff --git a/src/azure-cli/azure/cli/command_modules/configure/__init__.py b/src/azure-cli/azure/cli/command_modules/configure/__init__.py index e50f1dabb5e..919910df774 100644 --- a/src/azure-cli/azure/cli/command_modules/configure/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/configure/__init__.py @@ -11,7 +11,7 @@ class ConfigureCommandsLoader(AzCommandsLoader): def __init__(self, cli_ctx=None): - super(ConfigureCommandsLoader, self).__init__(cli_ctx=cli_ctx) + super().__init__(cli_ctx=cli_ctx) def load_command_table(self, args): from azure.cli.command_modules.configure.commands import load_command_table diff --git a/src/azure-cli/azure/cli/command_modules/consumption/__init__.py b/src/azure-cli/azure/cli/command_modules/consumption/__init__.py index 731b68ee7bd..36b3b89aa0c 100644 --- a/src/azure-cli/azure/cli/command_modules/consumption/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/consumption/__init__.py @@ -12,7 +12,7 @@ class ConsumptionCommandsLoader(AzCommandsLoader): def __init__(self, cli_ctx=None): from azure.cli.core.commands import CliCommandType consumption_custom = CliCommandType(operations_tmpl='azure.cli.command_modules.consumption.custom#{}') - super(ConsumptionCommandsLoader, self).__init__(cli_ctx=cli_ctx, custom_command_type=consumption_custom) + super().__init__(cli_ctx=cli_ctx, custom_command_type=consumption_custom) def load_command_table(self, args): from azure.cli.command_modules.consumption.commands import load_command_table diff --git a/src/azure-cli/azure/cli/command_modules/container/__init__.py b/src/azure-cli/azure/cli/command_modules/container/__init__.py index 1edbbee2295..8bfa50516dc 100644 --- a/src/azure-cli/azure/cli/command_modules/container/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/container/__init__.py @@ -14,9 +14,9 @@ def __init__(self, cli_ctx=None): from azure.cli.core.commands import CliCommandType from azure.cli.core.profiles import ResourceType custom_type = CliCommandType(operations_tmpl='azure.cli.command_modules.container.custom#{}') - super(ContainerCommandsLoader, self).__init__(cli_ctx=cli_ctx, - custom_command_type=custom_type, - resource_type=ResourceType.MGMT_CONTAINERINSTANCE) + super().__init__(cli_ctx=cli_ctx, + custom_command_type=custom_type, + resource_type=ResourceType.MGMT_CONTAINERINSTANCE) def load_command_table(self, args): from azure.cli.command_modules.container.commands import load_command_table diff --git a/src/azure-cli/azure/cli/command_modules/containerapp/__init__.py b/src/azure-cli/azure/cli/command_modules/containerapp/__init__.py index 834d9075cd1..d868a87cc2f 100644 --- a/src/azure-cli/azure/cli/command_modules/containerapp/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/containerapp/__init__.py @@ -2,7 +2,6 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- -# pylint: disable=super-with-arguments from azure.cli.core import AzCommandsLoader @@ -16,8 +15,7 @@ def __init__(self, cli_ctx=None): containerapp_custom = CliCommandType( operations_tmpl='azure.cli.command_modules.containerapp.custom#{}', client_factory=None) - super(ContainerappCommandsLoader, self).__init__(cli_ctx=cli_ctx, - custom_command_type=containerapp_custom) + super().__init__(cli_ctx=cli_ctx, custom_command_type=containerapp_custom) def load_command_table(self, args): from azure.cli.command_modules.containerapp.commands import load_command_table diff --git a/src/azure-cli/azure/cli/command_modules/cosmosdb/__init__.py b/src/azure-cli/azure/cli/command_modules/cosmosdb/__init__.py index 31c151a1c19..d1493ab8b58 100644 --- a/src/azure-cli/azure/cli/command_modules/cosmosdb/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/cosmosdb/__init__.py @@ -29,10 +29,10 @@ def __init__(self, cli_ctx=None): cli_ctx.register_event(EVENT_INVOKER_PRE_PARSE_ARGS, _documentdb_deprecate) - super(CosmosDbCommandsLoader, self).__init__(cli_ctx=cli_ctx, - resource_type=ResourceType.MGMT_COSMOSDB, - custom_command_type=cosmosdb_custom, - command_group_cls=CosmosDbCommandGroup) + super().__init__(cli_ctx=cli_ctx, + resource_type=ResourceType.MGMT_COSMOSDB, + custom_command_type=cosmosdb_custom, + command_group_cls=CosmosDbCommandGroup) def load_command_table(self, args): from azure.cli.command_modules.cosmosdb.commands import load_command_table diff --git a/src/azure-cli/azure/cli/command_modules/databoxedge/__init__.py b/src/azure-cli/azure/cli/command_modules/databoxedge/__init__.py index 8b88d198cff..a246c888195 100644 --- a/src/azure-cli/azure/cli/command_modules/databoxedge/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/databoxedge/__init__.py @@ -23,9 +23,8 @@ def __init__(self, cli_ctx=None): from azure.cli.core.profiles import ResourceType databoxedge_custom = CliCommandType( operations_tmpl='azure.cli.command_modules.databoxedge.custom#{}') - parent = super(DataBoxEdgeManagementClientCommandsLoader, self) - parent.__init__(cli_ctx=cli_ctx, custom_command_type=databoxedge_custom, - resource_type=ResourceType.MGMT_DATABOXEDGE) + super().__init__(cli_ctx=cli_ctx, custom_command_type=databoxedge_custom, + resource_type=ResourceType.MGMT_DATABOXEDGE) def load_command_table(self, args): from .generated.commands import load_command_table diff --git a/src/azure-cli/azure/cli/command_modules/dls/__init__.py b/src/azure-cli/azure/cli/command_modules/dls/__init__.py index a0abcc53801..fdc2161f37f 100644 --- a/src/azure-cli/azure/cli/command_modules/dls/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/dls/__init__.py @@ -2,7 +2,6 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- -# pylint: disable=unused-import from azure.cli.core import AzCommandsLoader @@ -15,9 +14,9 @@ def __init__(self, cli_ctx=None): from azure.cli.core.commands import CliCommandType from azure.cli.core.profiles import ResourceType dls_custom = CliCommandType(operations_tmpl='azure.cli.command_modules.dls.custom#{}') - super(DataLakeStoreCommandsLoader, self).__init__(cli_ctx=cli_ctx, - resource_type=ResourceType.MGMT_DATALAKE_STORE, - custom_command_type=dls_custom) + super().__init__(cli_ctx=cli_ctx, + resource_type=ResourceType.MGMT_DATALAKE_STORE, + custom_command_type=dls_custom) def load_command_table(self, args): from azure.cli.command_modules.dls.commands import load_command_table diff --git a/src/azure-cli/azure/cli/command_modules/dls/tests/latest/test_dls_commands.py b/src/azure-cli/azure/cli/command_modules/dls/tests/latest/test_dls_commands.py index 902778be3b3..2212377e278 100644 --- a/src/azure-cli/azure/cli/command_modules/dls/tests/latest/test_dls_commands.py +++ b/src/azure-cli/azure/cli/command_modules/dls/tests/latest/test_dls_commands.py @@ -127,14 +127,14 @@ def const_uuid(): self.mp = mock.patch('uuid.uuid4', const_uuid) self.mp.__enter__() - super(DataLakeStoreFileScenarioTest, self).setUp() + super().setUp() def tearDown(self): local_folder = self.kwargs.get('local_folder', None) if local_folder and os.path.exists(local_folder): rmtree(local_folder) self.mp.__exit__(None, None, None) - return super(DataLakeStoreFileScenarioTest, self).tearDown() + return super().tearDown() @ResourceGroupPreparer(name_prefix='cls_test_adls_file') def test_dls_file_mgmt(self): diff --git a/src/azure-cli/azure/cli/command_modules/dms/__init__.py b/src/azure-cli/azure/cli/command_modules/dms/__init__.py index 72bd8b43dc9..2bfe3db2f3e 100644 --- a/src/azure-cli/azure/cli/command_modules/dms/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/dms/__init__.py @@ -16,9 +16,9 @@ def __init__(self, cli_ctx=None): from azure.cli.core.commands import CliCommandType from azure.cli.core.profiles import ResourceType dms_custom = CliCommandType(operations_tmpl='azure.cli.command_modules.dms.custom#{}') - super(DmsCommandsLoader, self).__init__(cli_ctx=cli_ctx, - resource_type=ResourceType.MGMT_DATAMIGRATION, - custom_command_type=dms_custom) + super().__init__(cli_ctx=cli_ctx, + resource_type=ResourceType.MGMT_DATAMIGRATION, + custom_command_type=dms_custom) def load_command_table(self, args): from azure.cli.command_modules.dms.commands import load_command_table diff --git a/src/azure-cli/azure/cli/command_modules/eventgrid/__init__.py b/src/azure-cli/azure/cli/command_modules/eventgrid/__init__.py index ecbde4ba7d0..0932c355fb7 100644 --- a/src/azure-cli/azure/cli/command_modules/eventgrid/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/eventgrid/__init__.py @@ -14,9 +14,9 @@ def __init__(self, cli_ctx=None): from azure.cli.core.commands import CliCommandType from azure.cli.core.profiles import ResourceType eventgrid_custom = CliCommandType(operations_tmpl='azure.cli.command_modules.eventgrid.custom#{}') - super(EventGridCommandsLoader, self).__init__(cli_ctx=cli_ctx, - custom_command_type=eventgrid_custom, - resource_type=ResourceType.MGMT_EVENTGRID) + super().__init__(cli_ctx=cli_ctx, + custom_command_type=eventgrid_custom, + resource_type=ResourceType.MGMT_EVENTGRID) def load_command_table(self, args): from azure.cli.command_modules.eventgrid.commands import load_command_table diff --git a/src/azure-cli/azure/cli/command_modules/eventhubs/__init__.py b/src/azure-cli/azure/cli/command_modules/eventhubs/__init__.py index 53283eb03f0..4ecac9d0e01 100644 --- a/src/azure-cli/azure/cli/command_modules/eventhubs/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/eventhubs/__init__.py @@ -6,7 +6,6 @@ from azure.cli.core import AzCommandsLoader # pylint: disable=unused-import -# pylint: disable=line-too-long from ._help import helps @@ -18,12 +17,12 @@ def __init__(self, cli_ctx=None): from azure.cli.core.commands import CliCommandType from azure.cli.core.profiles import ResourceType eventhub_custom = CliCommandType(operations_tmpl='azure.cli.command_modules.eventhubs.custom#{}') - super(EventhubCommandsLoader, self).__init__(cli_ctx=cli_ctx, - custom_command_type=eventhub_custom, - resource_type=ResourceType.MGMT_EVENTHUB, - suppress_extension=ModExtensionSuppress(__name__, 'eventhubs', '0.0.1', - reason='These commands are now in the CLI.', - recommend_remove=True)) + super().__init__(cli_ctx=cli_ctx, + custom_command_type=eventhub_custom, + resource_type=ResourceType.MGMT_EVENTHUB, + suppress_extension=ModExtensionSuppress(__name__, 'eventhubs', '0.0.1', + reason='These commands are now in the CLI.', + recommend_remove=True)) def load_command_table(self, args): from azure.cli.command_modules.eventhubs.commands import load_command_table diff --git a/src/azure-cli/azure/cli/command_modules/eventhubs/action.py b/src/azure-cli/azure/cli/command_modules/eventhubs/action.py index a93d7379049..6cf679b0796 100644 --- a/src/azure-cli/azure/cli/command_modules/eventhubs/action.py +++ b/src/azure-cli/azure/cli/command_modules/eventhubs/action.py @@ -15,7 +15,7 @@ class AlertAddEncryption(argparse._AppendAction): def __call__(self, parser, namespace, values, option_string=None): action = self.get_action(values, option_string) - super(AlertAddEncryption, self).__call__(parser, namespace, action, option_string) + super().__call__(parser, namespace, action, option_string) def get_action(self, values, option_string): # pylint: disable=no-self-use from azure.cli.core import CLIError @@ -54,7 +54,7 @@ def get_action(self, values, option_string): # pylint: disable=no-self-use class AlertAddVirtualNetwork(argparse._AppendAction): def __call__(self, parser, namespace, values, option_string=None): action = self.get_action(values, option_string) - super(AlertAddVirtualNetwork, self).__call__(parser, namespace, action, option_string) + super().__call__(parser, namespace, action, option_string) def get_action(self, values, option_string): # pylint: disable=no-self-use from azure.cli.core import CLIError @@ -80,7 +80,7 @@ def get_action(self, values, option_string): # pylint: disable=no-self-use class AlertAddIpRule(argparse._AppendAction): def __call__(self, parser, namespace, values, option_string=None): action = self.get_action(values, option_string) - super(AlertAddIpRule, self).__call__(parser, namespace, action, option_string) + super().__call__(parser, namespace, action, option_string) def get_action(self, values, option_string): # pylint: disable=no-self-use from azure.cli.core import CLIError @@ -106,7 +106,7 @@ def get_action(self, values, option_string): # pylint: disable=no-self-use class ConstructPolicy(argparse._AppendAction): def __call__(self, parser, namespace, values, option_string=None): action = self.get_action(values, option_string) - super(ConstructPolicy, self).__call__(parser, namespace, action, option_string) + super().__call__(parser, namespace, action, option_string) def get_action(self, values, option_string): # pylint: disable=no-self-use from azure.cli.core.azclierror import RequiredArgumentMissingError @@ -158,7 +158,7 @@ def get_action(self, values, option_string): # pylint: disable=no-self-use class ConstructPolicyName(argparse._AppendAction): def __call__(self, parser, namespace, values, option_string=None): action = self.get_action(values, option_string) - super(ConstructPolicyName, self).__call__(parser, namespace, action, option_string) + super().__call__(parser, namespace, action, option_string) def get_action(self, values, option_string): # pylint: disable=no-self-use from azure.cli.core.azclierror import RequiredArgumentMissingError @@ -179,7 +179,7 @@ def get_action(self, values, option_string): # pylint: disable=no-self-use class AlertAddlocation(argparse._AppendAction): def __call__(self, parser, namespace, values, option_string=None): action = self.get_action(values, option_string) - super(AlertAddlocation, self).__call__(parser, namespace, action, option_string) + super().__call__(parser, namespace, action, option_string) def get_action(self, values, option_string): # pylint: disable=no-self-use from azure.cli.core import CLIError diff --git a/src/azure-cli/azure/cli/command_modules/extension/__init__.py b/src/azure-cli/azure/cli/command_modules/extension/__init__.py index 399affca64a..c45e8586966 100644 --- a/src/azure-cli/azure/cli/command_modules/extension/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/extension/__init__.py @@ -20,7 +20,7 @@ class ExtensionCommandsLoader(AzCommandsLoader): def __init__(self, cli_ctx=None): - super(ExtensionCommandsLoader, self).__init__(cli_ctx=cli_ctx) + super().__init__(cli_ctx=cli_ctx) def load_command_table(self, args): diff --git a/src/azure-cli/azure/cli/command_modules/feedback/__init__.py b/src/azure-cli/azure/cli/command_modules/feedback/__init__.py index ff8cf9967ed..441956dab11 100644 --- a/src/azure-cli/azure/cli/command_modules/feedback/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/feedback/__init__.py @@ -12,7 +12,7 @@ class FeedbackCommandsLoader(AzCommandsLoader): def __init__(self, cli_ctx=None): - super(FeedbackCommandsLoader, self).__init__(cli_ctx=cli_ctx) + super().__init__(cli_ctx=cli_ctx) def load_command_table(self, args): custom_feedback = CliCommandType(operations_tmpl='azure.cli.command_modules.feedback.custom#{}') diff --git a/src/azure-cli/azure/cli/command_modules/feedback/tests/latest/test_feedback.py b/src/azure-cli/azure/cli/command_modules/feedback/tests/latest/test_feedback.py index f712a0a84ef..e4a5d56d13d 100644 --- a/src/azure-cli/azure/cli/command_modules/feedback/tests/latest/test_feedback.py +++ b/src/azure-cli/azure/cli/command_modules/feedback/tests/latest/test_feedback.py @@ -33,7 +33,7 @@ class TestCommandLogFile(ScenarioTest): def __init__(self, *args, **kwargs): - super(TestCommandLogFile, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) self.disable_recording = True self.is_live = True @@ -45,7 +45,7 @@ def _add_alias(self, command_log_dir, logger): self.cmd("az extension add -n alias") logger.warning("Adding whl ext alias") - super(TestCommandLogFile, self).setUp() + super().setUp() self.temp_command_log_dir = self.create_temp_dir() # if alias is installed as a wheel extension. Remove it for now and re-install it later. diff --git a/src/azure-cli/azure/cli/command_modules/find/__init__.py b/src/azure-cli/azure/cli/command_modules/find/__init__.py index b650dfe2c3e..ef32bd2689a 100644 --- a/src/azure-cli/azure/cli/command_modules/find/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/find/__init__.py @@ -13,12 +13,12 @@ def __init__(self, cli_ctx=None): from azure.cli.core.commands import CliCommandType from azure.cli.core import ModExtensionSuppress find_custom = CliCommandType(operations_tmpl='azure.cli.command_modules.find.custom#{}') - super(FindCommandsLoader, self).__init__(cli_ctx=cli_ctx, - custom_command_type=find_custom, - suppress_extension=ModExtensionSuppress( - __name__, 'find', '0.3.0', - reason='The find command is now in CLI.', - recommend_remove=True)) + super().__init__(cli_ctx=cli_ctx, + custom_command_type=find_custom, + suppress_extension=ModExtensionSuppress( + __name__, 'find', '0.3.0', + reason='The find command is now in CLI.', + recommend_remove=True)) self.module_name = __name__ def load_command_table(self, args): diff --git a/src/azure-cli/azure/cli/command_modules/hdinsight/__init__.py b/src/azure-cli/azure/cli/command_modules/hdinsight/__init__.py index b6792cb7591..40c637bcdb7 100644 --- a/src/azure-cli/azure/cli/command_modules/hdinsight/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/hdinsight/__init__.py @@ -15,7 +15,7 @@ def __init__(self, cli_ctx=None): operations_tmpl='azure.cli.command_modules.hdinsight.custom#{}', operation_group='hdinsight') - super(HDInsightCommandsLoader, self).__init__( + super().__init__( cli_ctx=cli_ctx, operation_group='hdinsight', custom_command_type=hdinsight_custom) diff --git a/src/azure-cli/azure/cli/command_modules/identity/__init__.py b/src/azure-cli/azure/cli/command_modules/identity/__init__.py index a75bda4bf59..63f5d8f56a4 100644 --- a/src/azure-cli/azure/cli/command_modules/identity/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/identity/__init__.py @@ -13,9 +13,9 @@ class IdentityCommandsLoader(AzCommandsLoader): def __init__(self, cli_ctx=None): from azure.cli.core.commands import CliCommandType identity_custom = CliCommandType(operations_tmpl='azure.cli.command_modules.identity.custom#{}') - super(IdentityCommandsLoader, self).__init__(cli_ctx=cli_ctx, - resource_type=ResourceType.MGMT_MSI, - custom_command_type=identity_custom) + super().__init__(cli_ctx=cli_ctx, + resource_type=ResourceType.MGMT_MSI, + custom_command_type=identity_custom) def load_command_table(self, args): from azure.cli.command_modules.identity.commands import load_command_table diff --git a/src/azure-cli/azure/cli/command_modules/interactive/__init__.py b/src/azure-cli/azure/cli/command_modules/interactive/__init__.py index 1c42e543857..dde131d555f 100644 --- a/src/azure-cli/azure/cli/command_modules/interactive/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/interactive/__init__.py @@ -20,7 +20,7 @@ class InteractiveCommandsLoader(AzCommandsLoader): def __init__(self, cli_ctx=None): from azure.cli.core import ModExtensionSuppress - super(InteractiveCommandsLoader, self).__init__( + super().__init__( cli_ctx=cli_ctx, suppress_extension=ModExtensionSuppress( __name__, 'alias', '0.5.1', diff --git a/src/azure-cli/azure/cli/command_modules/iot/__init__.py b/src/azure-cli/azure/cli/command_modules/iot/__init__.py index 1dbcf9d0afe..e9d01218168 100644 --- a/src/azure-cli/azure/cli/command_modules/iot/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/iot/__init__.py @@ -14,9 +14,9 @@ class IoTCommandsLoader(AzCommandsLoader): def __init__(self, cli_ctx=None): from azure.cli.core.profiles import ResourceType iot_custom = CliCommandType(operations_tmpl='azure.cli.command_modules.iot.custom#{}') - super(IoTCommandsLoader, self).__init__(cli_ctx=cli_ctx, - custom_command_type=iot_custom, - resource_type=ResourceType.MGMT_IOTHUB) + super().__init__(cli_ctx=cli_ctx, + custom_command_type=iot_custom, + resource_type=ResourceType.MGMT_IOTHUB) def load_command_table(self, args): from azure.cli.command_modules.iot.commands import load_command_table diff --git a/src/azure-cli/azure/cli/command_modules/iot/commands.py b/src/azure-cli/azure/cli/command_modules/iot/commands.py index f8b123424fe..1bd16c10f26 100644 --- a/src/azure-cli/azure/cli/command_modules/iot/commands.py +++ b/src/azure-cli/azure/cli/command_modules/iot/commands.py @@ -16,19 +16,19 @@ class PolicyUpdateResultTransform(LongRunningOperation): # pylint: disable=too-few-public-methods def __call__(self, poller): - result = super(PolicyUpdateResultTransform, self).__call__(poller) + result = super().__call__(poller) return result.properties.authorization_policies class EndpointUpdateResultTransform(LongRunningOperation): # pylint: disable=too-few-public-methods def __call__(self, poller): - result = super(EndpointUpdateResultTransform, self).__call__(poller) + result = super().__call__(poller) return result.properties.routing.endpoints class RouteUpdateResultTransform(LongRunningOperation): # pylint: disable=too-few-public-methods def __call__(self, poller): - result = super(RouteUpdateResultTransform, self).__call__(poller) + result = super().__call__(poller) return result.properties.routing.routes @@ -42,7 +42,7 @@ def __call__(self, poller): if not poller: return poller try: - super(HubDeleteResultTransform, self).__call__(poller) + super().__call__(poller) except CLIError as e: if 'not found' not in str(e): raise e diff --git a/src/azure-cli/azure/cli/command_modules/iot/sas_token_auth.py b/src/azure-cli/azure/cli/command_modules/iot/sas_token_auth.py index 90e6cc9538b..ca623b9c550 100644 --- a/src/azure-cli/azure/cli/command_modules/iot/sas_token_auth.py +++ b/src/azure-cli/azure/cli/command_modules/iot/sas_token_auth.py @@ -39,7 +39,7 @@ def signed_session(self, session=None): :rtype: requests.Session. """ - session = session or super(SasTokenAuthentication, self).signed_session() + session = session or super().signed_session() session.headers['Authorization'] = self.generate_sas_token() return session diff --git a/src/azure-cli/azure/cli/command_modules/iot/tests/hybrid_2019_03_01/test_iot_certificate_commands.py b/src/azure-cli/azure/cli/command_modules/iot/tests/hybrid_2019_03_01/test_iot_certificate_commands.py index 3f359546953..7f78e200d94 100644 --- a/src/azure-cli/azure/cli/command_modules/iot/tests/hybrid_2019_03_01/test_iot_certificate_commands.py +++ b/src/azure-cli/azure/cli/command_modules/iot/tests/hybrid_2019_03_01/test_iot_certificate_commands.py @@ -19,13 +19,13 @@ class IotHubCertificateTest(ScenarioTest): def __init__(self, test_method): - super(IotHubCertificateTest, self).__init__('test_certificate_lifecycle') + super().__init__('test_certificate_lifecycle') self.hub_name = 'iot-hub-for-cert-test' _create_test_cert(CERT_FILE, KEY_FILE, self.create_random_name(prefix='TESTCERT', length=24), 3, random.randint(0, MAX_INT)) def tearDown(self): _delete_test_cert(CERT_FILE, KEY_FILE, VERIFICATION_FILE) - super(IotHubCertificateTest, self).tearDown() + super().tearDown() @ResourceGroupPreparer() def test_certificate_lifecycle(self, resource_group): diff --git a/src/azure-cli/azure/cli/command_modules/iot/tests/hybrid_2019_03_01/test_iot_commands.py b/src/azure-cli/azure/cli/command_modules/iot/tests/hybrid_2019_03_01/test_iot_commands.py index 1c3ad814557..17d7fa2b5f9 100644 --- a/src/azure-cli/azure/cli/command_modules/iot/tests/hybrid_2019_03_01/test_iot_commands.py +++ b/src/azure-cli/azure/cli/command_modules/iot/tests/hybrid_2019_03_01/test_iot_commands.py @@ -11,7 +11,7 @@ class IoTHubTest(ScenarioTest): def __init__(self, method_name): - super(IoTHubTest, self).__init__( + super().__init__( method_name, recording_processors=[KeyReplacer()] ) diff --git a/src/azure-cli/azure/cli/command_modules/iot/tests/hybrid_2020_09_01/test_iot_certificate_commands.py b/src/azure-cli/azure/cli/command_modules/iot/tests/hybrid_2020_09_01/test_iot_certificate_commands.py index a217ad4124a..abfd3241791 100644 --- a/src/azure-cli/azure/cli/command_modules/iot/tests/hybrid_2020_09_01/test_iot_certificate_commands.py +++ b/src/azure-cli/azure/cli/command_modules/iot/tests/hybrid_2020_09_01/test_iot_certificate_commands.py @@ -20,13 +20,13 @@ class IotHubCertificateTest(ScenarioTest): def __init__(self, test_method): - super(IotHubCertificateTest, self).__init__('test_certificate_lifecycle') + super().__init__('test_certificate_lifecycle') self.hub_name = 'iot-hub-for-cert-test' _create_test_cert(CERT_FILE, KEY_FILE, self.create_random_name(prefix='TESTCERT', length=24), 3, random.randint(0, MAX_INT)) def tearDown(self): _delete_test_cert([CERT_FILE, KEY_FILE, VERIFICATION_FILE]) - super(IotHubCertificateTest, self).tearDown() + super().tearDown() @ResourceGroupPreparer() def test_certificate_lifecycle(self, resource_group): diff --git a/src/azure-cli/azure/cli/command_modules/iot/tests/hybrid_2020_09_01/test_iot_commands.py b/src/azure-cli/azure/cli/command_modules/iot/tests/hybrid_2020_09_01/test_iot_commands.py index 2f2baa8ed2d..f2e00b19765 100644 --- a/src/azure-cli/azure/cli/command_modules/iot/tests/hybrid_2020_09_01/test_iot_commands.py +++ b/src/azure-cli/azure/cli/command_modules/iot/tests/hybrid_2020_09_01/test_iot_commands.py @@ -13,7 +13,7 @@ class IoTHubTest(ScenarioTest): def __init__(self, method_name): - super(IoTHubTest, self).__init__( + super().__init__( method_name, recording_processors=[KeyReplacer()] ) diff --git a/src/azure-cli/azure/cli/command_modules/iot/tests/latest/test_iot_certificate_commands.py b/src/azure-cli/azure/cli/command_modules/iot/tests/latest/test_iot_certificate_commands.py index c2eb8467657..056f532ccac 100644 --- a/src/azure-cli/azure/cli/command_modules/iot/tests/latest/test_iot_certificate_commands.py +++ b/src/azure-cli/azure/cli/command_modules/iot/tests/latest/test_iot_certificate_commands.py @@ -20,14 +20,14 @@ class IotHubCertificateTest(ScenarioTest): def __init__(self, test_method): - super(IotHubCertificateTest, self).__init__('test_certificate_lifecycle') + super().__init__('test_certificate_lifecycle') self.hub_name = 'iot-hub-for-cert-test' _create_test_cert(CERT_FILE, KEY_FILE, self.create_random_name(prefix='TESTCERT', length=24), 3, random.randint(0, MAX_INT)) _create_fake_chain_cert(CERT_FILE, CHAIN_FILE) def tearDown(self): _delete_test_cert([CERT_FILE, KEY_FILE, VERIFICATION_FILE, CHAIN_FILE]) - super(IotHubCertificateTest, self).tearDown() + super().tearDown() @ResourceGroupPreparer() def test_certificate_lifecycle(self, resource_group): diff --git a/src/azure-cli/azure/cli/command_modules/iot/tests/latest/test_iot_commands.py b/src/azure-cli/azure/cli/command_modules/iot/tests/latest/test_iot_commands.py index ed8749ffb50..c1e0634a2df 100644 --- a/src/azure-cli/azure/cli/command_modules/iot/tests/latest/test_iot_commands.py +++ b/src/azure-cli/azure/cli/command_modules/iot/tests/latest/test_iot_commands.py @@ -18,7 +18,7 @@ class IoTHubTest(ScenarioTest): def __init__(self, method_name): - super(IoTHubTest, self).__init__( + super().__init__( method_name, recording_processors=[KeyReplacer()] ) diff --git a/src/azure-cli/azure/cli/command_modules/iot/tests/latest/test_iot_dps_commands.py b/src/azure-cli/azure/cli/command_modules/iot/tests/latest/test_iot_dps_commands.py index d5b321d1735..42fed70b3bf 100644 --- a/src/azure-cli/azure/cli/command_modules/iot/tests/latest/test_iot_dps_commands.py +++ b/src/azure-cli/azure/cli/command_modules/iot/tests/latest/test_iot_dps_commands.py @@ -18,7 +18,7 @@ class IoTDpsTest(ScenarioTest): def __init__(self, method_name): - super(IoTDpsTest, self).__init__( + super().__init__( method_name, recording_processors=[KeyReplacer()] ) diff --git a/src/azure-cli/azure/cli/command_modules/keyvault/__init__.py b/src/azure-cli/azure/cli/command_modules/keyvault/__init__.py index bae4e718da4..85623de0167 100644 --- a/src/azure-cli/azure/cli/command_modules/keyvault/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/keyvault/__init__.py @@ -20,7 +20,7 @@ def __init__(self, cli_ctx=None): client_factory=keyvault_mgmt_client_factory ) - super(KeyVaultCommandsLoader, self).__init__( + super().__init__( cli_ctx=cli_ctx, resource_type=ResourceType.MGMT_KEYVAULT, operation_group="vaults", diff --git a/src/azure-cli/azure/cli/command_modules/keyvault/_command_type.py b/src/azure-cli/azure/cli/command_modules/keyvault/_command_type.py index f2623698fba..75a63077c17 100644 --- a/src/azure-cli/azure/cli/command_modules/keyvault/_command_type.py +++ b/src/azure-cli/azure/cli/command_modules/keyvault/_command_type.py @@ -55,7 +55,7 @@ def __init__(self, command_loader, group_name, **kwargs): from azure.cli.command_modules.keyvault._client_factory import keyvault_mgmt_client_factory merged_kwargs = self._merge_kwargs(kwargs, base_kwargs=command_loader.module_kwargs) merged_kwargs['custom_command_type'].settings['client_factory'] = keyvault_mgmt_client_factory - super(KeyVaultCommandGroup, self).__init__(command_loader, group_name, **kwargs) + super().__init__(command_loader, group_name, **kwargs) def _create_keyvault_command(self, name, method_name=None, command_type_name=None, **kwargs): self._check_stale() diff --git a/src/azure-cli/azure/cli/command_modules/keyvault/tests/latest/test_keyvault_commands.py b/src/azure-cli/azure/cli/command_modules/keyvault/tests/latest/test_keyvault_commands.py index f40ade0818f..01777be57d6 100644 --- a/src/azure-cli/azure/cli/command_modules/keyvault/tests/latest/test_keyvault_commands.py +++ b/src/azure-cli/azure/cli/command_modules/keyvault/tests/latest/test_keyvault_commands.py @@ -900,7 +900,7 @@ def process_request(self, request): class KeyVaultHSMRoleDefintionTest(ScenarioTest): def __init__(self, method_name): - super(KeyVaultHSMRoleDefintionTest, self).__init__( + super().__init__( method_name, recording_processors=[RoleDefinitionNameReplacer()], replay_processors=[RoleDefinitionNameReplacer()] diff --git a/src/azure-cli/azure/cli/command_modules/keyvault/vendored_sdks/azure_keyvault_securitydomain/_internal/challenge_auth_policy.py b/src/azure-cli/azure/cli/command_modules/keyvault/vendored_sdks/azure_keyvault_securitydomain/_internal/challenge_auth_policy.py index eb4073d0e69..3dcf029e6ea 100644 --- a/src/azure-cli/azure/cli/command_modules/keyvault/vendored_sdks/azure_keyvault_securitydomain/_internal/challenge_auth_policy.py +++ b/src/azure-cli/azure/cli/command_modules/keyvault/vendored_sdks/azure_keyvault_securitydomain/_internal/challenge_auth_policy.py @@ -89,7 +89,7 @@ class ChallengeAuthPolicy(BearerTokenCredentialPolicy): def __init__(self, credential: TokenProvider, *scopes: str, **kwargs: Any) -> None: # Pass `enable_cae` so `enable_cae=True` is always passed through self.authorize_request - super(ChallengeAuthPolicy, self).__init__(credential, *scopes, enable_cae=True, **kwargs) + super().__init__(credential, *scopes, enable_cae=True, **kwargs) self._credential: TokenProvider = credential self._token: Optional[Union["AccessToken", "AccessTokenInfo"]] = None self._verify_challenge_resource = kwargs.pop("verify_challenge_resource", True) diff --git a/src/azure-cli/azure/cli/command_modules/keyvault/vendored_sdks/azure_keyvault_securitydomain/_model_base.py b/src/azure-cli/azure/cli/command_modules/keyvault/vendored_sdks/azure_keyvault_securitydomain/_model_base.py index 9d401b0cf01..9373eed880a 100644 --- a/src/azure-cli/azure/cli/command_modules/keyvault/vendored_sdks/azure_keyvault_securitydomain/_model_base.py +++ b/src/azure-cli/azure/cli/command_modules/keyvault/vendored_sdks/azure_keyvault_securitydomain/_model_base.py @@ -145,7 +145,7 @@ def default(self, o): # pylint: disable=too-many-return-statements return {k: v for k, v in o.items() if k not in readonly_props} return dict(o.items()) try: - return super(SdkJSONEncoder, self).default(o) + return super().default(o) except TypeError: if isinstance(o, _Null): return None @@ -164,7 +164,7 @@ def default(self, o): # pylint: disable=too-many-return-statements except AttributeError: # This will be raised when it hits value.total_seconds in the method above pass - return super(SdkJSONEncoder, self).default(o) + return super().default(o) _VALID_DATE = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" + r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") diff --git a/src/azure-cli/azure/cli/command_modules/lab/__init__.py b/src/azure-cli/azure/cli/command_modules/lab/__init__.py index 2a158686b42..7040888717f 100644 --- a/src/azure-cli/azure/cli/command_modules/lab/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/lab/__init__.py @@ -13,7 +13,7 @@ class DevTestLabCommandsLoader(AzCommandsLoader): def __init__(self, cli_ctx=None): from azure.cli.core.commands import CliCommandType lab_custom = CliCommandType(operations_tmpl='azure.cli.command_modules.lab.custom#{}') - super(DevTestLabCommandsLoader, self).__init__(cli_ctx=cli_ctx, custom_command_type=lab_custom) + super().__init__(cli_ctx=cli_ctx, custom_command_type=lab_custom) def load_command_table(self, args): from azure.cli.command_modules.lab.commands import load_command_table diff --git a/src/azure-cli/azure/cli/command_modules/managedservices/__init__.py b/src/azure-cli/azure/cli/command_modules/managedservices/__init__.py index 4a3526ba84b..56775fdd2fc 100644 --- a/src/azure-cli/azure/cli/command_modules/managedservices/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/managedservices/__init__.py @@ -12,8 +12,7 @@ class ManagedServicesCommandsLoader(AzCommandsLoader): def __init__(self, cli_ctx=None): from azure.cli.core.commands import CliCommandType managedservices_custom = CliCommandType(operations_tmpl='azure.cli.command_modules.managedservices.custom#{}') - super(ManagedServicesCommandsLoader, self).__init__(cli_ctx=cli_ctx, - custom_command_type=managedservices_custom) + super().__init__(cli_ctx=cli_ctx, custom_command_type=managedservices_custom) def load_command_table(self, args): from .commands import load_command_table diff --git a/src/azure-cli/azure/cli/command_modules/maps/__init__.py b/src/azure-cli/azure/cli/command_modules/maps/__init__.py index 4b445578e3d..ec9963ef55b 100644 --- a/src/azure-cli/azure/cli/command_modules/maps/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/maps/__init__.py @@ -17,9 +17,9 @@ def __init__(self, cli_ctx=None): custom_type = CliCommandType( operations_tmpl='azure.cli.command_modules.maps.custom#{}', client_factory=cf_accounts) - super(MapsCommandsLoader, self).__init__(cli_ctx=cli_ctx, - custom_command_type=custom_type, - resource_type=ResourceType.MGMT_MAPS) + super().__init__(cli_ctx=cli_ctx, + custom_command_type=custom_type, + resource_type=ResourceType.MGMT_MAPS) def load_command_table(self, args): from azure.cli.command_modules.maps.commands import load_command_table diff --git a/src/azure-cli/azure/cli/command_modules/maps/action.py b/src/azure-cli/azure/cli/command_modules/maps/action.py index ba8518564a3..7b806ad92fe 100644 --- a/src/azure-cli/azure/cli/command_modules/maps/action.py +++ b/src/azure-cli/azure/cli/command_modules/maps/action.py @@ -17,7 +17,7 @@ class AddLinkedResources(argparse._AppendAction): def __call__(self, parser, namespace, values, option_string=None): action = self.get_action(values, option_string) - super(AddLinkedResources, self).__call__(parser, namespace, action, option_string) + super().__call__(parser, namespace, action, option_string) def get_action(self, values, option_string): # pylint: disable=no-self-use try: diff --git a/src/azure-cli/azure/cli/command_modules/marketplaceordering/__init__.py b/src/azure-cli/azure/cli/command_modules/marketplaceordering/__init__.py index 671dbcb7900..797a8b84f79 100644 --- a/src/azure-cli/azure/cli/command_modules/marketplaceordering/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/marketplaceordering/__init__.py @@ -20,8 +20,7 @@ def __init__(self, cli_ctx=None): marketplaceordering_custom = CliCommandType( operations_tmpl='azure.cli.command_modules.marketplaceordering.custom#{}', client_factory=cf_marketplaceordering_cl) - parent = super(MarketplaceOrderingAgreementsCommandsLoader, self) - parent.__init__(cli_ctx=cli_ctx, custom_command_type=marketplaceordering_custom) + super().__init__(cli_ctx=cli_ctx, custom_command_type=marketplaceordering_custom) def load_command_table(self, args): from .generated.commands import load_command_table diff --git a/src/azure-cli/azure/cli/command_modules/marketplaceordering/tests/latest/test_marketplaceordering_scenario.py b/src/azure-cli/azure/cli/command_modules/marketplaceordering/tests/latest/test_marketplaceordering_scenario.py index 4910f963dc2..8271959b0f2 100644 --- a/src/azure-cli/azure/cli/command_modules/marketplaceordering/tests/latest/test_marketplaceordering_scenario.py +++ b/src/azure-cli/azure/cli/command_modules/marketplaceordering/tests/latest/test_marketplaceordering_scenario.py @@ -46,8 +46,6 @@ def call_scenario(test): # Test class for Scenario @try_manual class MarketplaceorderingScenarioTest(ScenarioTest): - def __init__(self, *args, **kwargs): - super(MarketplaceorderingScenarioTest, self).__init__(*args, **kwargs) def test_marketplaceordering_Scenario(self): call_scenario(self) diff --git a/src/azure-cli/azure/cli/command_modules/monitor/__init__.py b/src/azure-cli/azure/cli/command_modules/monitor/__init__.py index 5b0c580df86..f36e4de78f3 100644 --- a/src/azure-cli/azure/cli/command_modules/monitor/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/monitor/__init__.py @@ -35,10 +35,10 @@ def __init__(self, cli_ctx=None): from azure.cli.core.profiles import ResourceType monitor_custom = CliCommandType( operations_tmpl='azure.cli.command_modules.monitor.custom#{}') - super(MonitorCommandsLoader, self).__init__(cli_ctx=cli_ctx, - resource_type=ResourceType.MGMT_MONITOR, - argument_context_cls=MonitorArgumentContext, - custom_command_type=monitor_custom) + super().__init__(cli_ctx=cli_ctx, + resource_type=ResourceType.MGMT_MONITOR, + argument_context_cls=MonitorArgumentContext, + custom_command_type=monitor_custom) def load_command_table(self, args): from azure.cli.command_modules.monitor.commands import load_command_table diff --git a/src/azure-cli/azure/cli/command_modules/monitor/actions.py b/src/azure-cli/azure/cli/command_modules/monitor/actions.py index 33afc027ea1..54cc73515d7 100644 --- a/src/azure-cli/azure/cli/command_modules/monitor/actions.py +++ b/src/azure-cli/azure/cli/command_modules/monitor/actions.py @@ -186,7 +186,7 @@ def __call__(self, parser, namespace, values, option_string=None): raise NotImplementedError() except (AttributeError, TypeError, KeyError): raise InvalidArgumentValueError(usage) - super(MetricAlertConditionAction, self).__call__(parser, namespace, metric_condition, option_string) + super().__call__(parser, namespace, metric_condition, option_string) # pylint: disable=protected-access, too-few-public-methods @@ -208,7 +208,7 @@ def __call__(self, parser, namespace, values, option_string=None): } action["odatatype"] = "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights." \ "Nexus.DataContracts.Resources.ScheduledQueryRules.Action" - super(MetricAlertAddAction, self).__call__(parser, namespace, action, option_string) + super().__call__(parser, namespace, action, option_string) # pylint: disable=too-few-public-methods @@ -241,7 +241,7 @@ def __call__(self, parser, namespace, values, option_string=None): class AlertAddAction(argparse._AppendAction): def __call__(self, parser, namespace, values, option_string=None): action = self.get_action(values, option_string) - super(AlertAddAction, self).__call__(parser, namespace, action, option_string) + super().__call__(parser, namespace, action, option_string) def get_action(self, values, option_string): # pylint: disable=no-self-use _type = values[0].lower() @@ -262,7 +262,7 @@ def get_action(self, values, option_string): # pylint: disable=no-self-use class AlertRemoveAction(argparse._AppendAction): def __call__(self, parser, namespace, values, option_string=None): action = self.get_action(values, option_string) - super(AlertRemoveAction, self).__call__(parser, namespace, action, option_string) + super().__call__(parser, namespace, action, option_string) def get_action(self, values, option_string): # pylint: disable=no-self-use # TYPE is artificially enforced to create consistency with the --add-action argument @@ -277,7 +277,7 @@ def get_action(self, values, option_string): # pylint: disable=no-self-use class AutoscaleCreateAction(argparse._AppendAction): def __call__(self, parser, namespace, values, option_string=None): action = self.get_action(values, option_string) - super(AutoscaleCreateAction, self).__call__(parser, namespace, action, option_string) + super().__call__(parser, namespace, action, option_string) def get_action(self, values, option_string): # pylint: disable=no-self-use _type = values[0].lower() @@ -308,7 +308,7 @@ def get_action(self, values, option_string): # pylint: disable=no-self-use class AutoscaleAddAction(argparse._AppendAction): def __call__(self, parser, namespace, values, option_string=None): action = self.get_action(values, option_string) - super(AutoscaleAddAction, self).__call__(parser, namespace, action, option_string) + super().__call__(parser, namespace, action, option_string) def get_action(self, values, option_string): # pylint: disable=no-self-use _type = values[0].lower() @@ -329,7 +329,7 @@ def get_action(self, values, option_string): # pylint: disable=no-self-use class AutoscaleRemoveAction(argparse._AppendAction): def __call__(self, parser, namespace, values, option_string=None): action = self.get_action(values, option_string) - super(AutoscaleRemoveAction, self).__call__(parser, namespace, action, option_string) + super().__call__(parser, namespace, action, option_string) def get_action(self, values, option_string): # pylint: disable=no-self-use # TYPE is artificially enforced to create consistency with the --add-action argument @@ -410,10 +410,10 @@ def __call__(self, parser, namespace, values, option_string=None): type_properties = values[1:] try: - super(MultiObjectsDeserializeAction, self).__call__(parser, - namespace, - self.deserialize_object(type_name, type_properties), - option_string) + super().__call__(parser, + namespace, + self.deserialize_object(type_name, type_properties), + option_string) except KeyError: raise InvalidArgumentValueError('the type "{}" is not recognizable.'.format(type_name)) except TypeError: diff --git a/src/azure-cli/azure/cli/command_modules/monitor/grammar/autoscale/AutoscaleConditionValidator.py b/src/azure-cli/azure/cli/command_modules/monitor/grammar/autoscale/AutoscaleConditionValidator.py index 4213e22b38b..3056127b34f 100644 --- a/src/azure-cli/azure/cli/command_modules/monitor/grammar/autoscale/AutoscaleConditionValidator.py +++ b/src/azure-cli/azure/cli/command_modules/monitor/grammar/autoscale/AutoscaleConditionValidator.py @@ -20,7 +20,7 @@ class AutoscaleConditionValidator(AutoscaleConditionListener): def __init__(self): - super(AutoscaleConditionValidator, self).__init__() + super().__init__() self.parameters = {} self._dimension_index = 0 diff --git a/src/azure-cli/azure/cli/command_modules/monitor/grammar/metric_alert/MetricAlertConditionValidator.py b/src/azure-cli/azure/cli/command_modules/monitor/grammar/metric_alert/MetricAlertConditionValidator.py index 7f47c0d175c..e324a6a509a 100644 --- a/src/azure-cli/azure/cli/command_modules/monitor/grammar/metric_alert/MetricAlertConditionValidator.py +++ b/src/azure-cli/azure/cli/command_modules/monitor/grammar/metric_alert/MetricAlertConditionValidator.py @@ -40,7 +40,7 @@ class MetricAlertConditionValidator(MetricAlertConditionListener): def __init__(self): - super(MetricAlertConditionValidator, self).__init__() + super().__init__() self.parameters = {} self._dimension_index = 0 diff --git a/src/azure-cli/azure/cli/command_modules/monitor/tests/latest/test_monitor_autoscale.py b/src/azure-cli/azure/cli/command_modules/monitor/tests/latest/test_monitor_autoscale.py index 1fb2c3cb8fb..0099406c83a 100644 --- a/src/azure-cli/azure/cli/command_modules/monitor/tests/latest/test_monitor_autoscale.py +++ b/src/azure-cli/azure/cli/command_modules/monitor/tests/latest/test_monitor_autoscale.py @@ -459,12 +459,12 @@ def test_monitor_autoscale_timezones(self): class TestMonitorAutoscaleComplexRules(LiveScenarioTest): def setUp(self): - super(TestMonitorAutoscaleComplexRules, self).setUp() + super().setUp() self.cmd('extension add -n spring-cloud') def tearDown(self): self.cmd('extension remove -n spring-cloud') - super(TestMonitorAutoscaleComplexRules, self).tearDown() + super().tearDown() @AllowLargeResponse() @ResourceGroupPreparer(name_prefix='cli_test_monitor_autoscale_rule_for_spring_cloud', location='westus2') diff --git a/src/azure-cli/azure/cli/command_modules/monitor/tests/latest/test_monitor_private_link_scope.py b/src/azure-cli/azure/cli/command_modules/monitor/tests/latest/test_monitor_private_link_scope.py index d29fe0e52d0..06b042ea0e8 100644 --- a/src/azure-cli/azure/cli/command_modules/monitor/tests/latest/test_monitor_private_link_scope.py +++ b/src/azure-cli/azure/cli/command_modules/monitor/tests/latest/test_monitor_private_link_scope.py @@ -10,7 +10,7 @@ class TestMonitorPrivateLinkScope(ScenarioTest): def __init__(self, method_name, config_file=None, recording_dir=None, recording_name=None, recording_processors=None, replay_processors=None, recording_patches=None, replay_patches=None): - super(TestMonitorPrivateLinkScope, self).__init__(method_name) + super().__init__(method_name) self.cmd('extension add -n application-insights') # @record_only() # record_only as the private-link-scope scoped-resource cannot find the components of application insights diff --git a/src/azure-cli/azure/cli/command_modules/mysql/action.py b/src/azure-cli/azure/cli/command_modules/mysql/action.py index ac8f954acc3..9c0b3bac428 100644 --- a/src/azure-cli/azure/cli/command_modules/mysql/action.py +++ b/src/azure-cli/azure/cli/command_modules/mysql/action.py @@ -11,7 +11,7 @@ class AddArgs(argparse._AppendAction): def __call__(self, parser, namespace, values, option_string=None): action = self.get_action(values, option_string) - super(AddArgs, self).__call__(parser, namespace, action, option_string) + super().__call__(parser, namespace, action, option_string) def get_action(self, values, option_string): # pylint: disable=no-self-use try: diff --git a/src/azure-cli/azure/cli/command_modules/mysql/tests/latest/test_mysql_scenario.py b/src/azure-cli/azure/cli/command_modules/mysql/tests/latest/test_mysql_scenario.py index f0381ff4328..12fe772afb8 100644 --- a/src/azure-cli/azure/cli/command_modules/mysql/tests/latest/test_mysql_scenario.py +++ b/src/azure-cli/azure/cli/command_modules/mysql/tests/latest/test_mysql_scenario.py @@ -51,7 +51,7 @@ class ServerPreparer(AbstractPreparer, SingleValueReplacer): def __init__(self, engine_type, location, engine_parameter_name='database_engine', name_prefix=SERVER_NAME_PREFIX, parameter_name='server', resource_group_parameter_name='resource_group'): - super(ServerPreparer, self).__init__(name_prefix, SERVER_NAME_MAX_LENGTH) + super().__init__(name_prefix, SERVER_NAME_MAX_LENGTH) from azure.cli.core.mock import DummyCli self.cli_ctx = DummyCli() self.engine_type = engine_type diff --git a/src/azure-cli/azure/cli/command_modules/netappfiles/__init__.py b/src/azure-cli/azure/cli/command_modules/netappfiles/__init__.py index 411b566b4ca..292932d471c 100644 --- a/src/azure-cli/azure/cli/command_modules/netappfiles/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/netappfiles/__init__.py @@ -13,9 +13,9 @@ class NetAppFilesCommandsLoader(AzCommandsLoader): def __init__(self, cli_ctx=None): from azure.cli.core.commands import CliCommandType netappfiles_custom = CliCommandType(operations_tmpl='azure.cli.command_modules.netappfiles.custom#{}') - super(NetAppFilesCommandsLoader, self).__init__(cli_ctx=cli_ctx, - resource_type=ResourceType.MGMT_NETAPPFILES, - custom_command_type=netappfiles_custom) + super().__init__(cli_ctx=cli_ctx, + resource_type=ResourceType.MGMT_NETAPPFILES, + custom_command_type=netappfiles_custom) def load_command_table(self, args): from azure.cli.command_modules.netappfiles.commands import load_command_table diff --git a/src/azure-cli/azure/cli/command_modules/network/__init__.py b/src/azure-cli/azure/cli/command_modules/network/__init__.py index e39d11b3fbf..2fe43ea8b52 100644 --- a/src/azure-cli/azure/cli/command_modules/network/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/network/__init__.py @@ -3,8 +3,6 @@ # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- -# pylint: disable=line-too-long - from azure.cli.core import AzCommandsLoader from azure.cli.core.profiles import ResourceType @@ -17,16 +15,20 @@ def __init__(self, cli_ctx=None): from azure.cli.core import ModExtensionSuppress from azure.cli.core.commands import CliCommandType network_custom = CliCommandType(operations_tmpl='azure.cli.command_modules.network.custom#{}') - super(NetworkCommandsLoader, self).__init__(cli_ctx=cli_ctx, - custom_command_type=network_custom, - suppress_extension=[ - ModExtensionSuppress(__name__, 'dns', '0.0.2', - reason='These commands are now in the CLI.', - recommend_remove=True), - ModExtensionSuppress(__name__, 'express-route', '0.1.3', - reason='These commands are now in the CLI.', - recommend_remove=True) - ]) + super().__init__( + cli_ctx=cli_ctx, + custom_command_type=network_custom, + suppress_extension=[ + ModExtensionSuppress( + __name__, 'dns', '0.0.2', + reason='These commands are now in the CLI.', + recommend_remove=True), + ModExtensionSuppress( + __name__, 'express-route', '0.1.3', + reason='These commands are now in the CLI.', + recommend_remove=True) + ] + ) def load_command_table(self, args): from azure.cli.command_modules.network.commands import load_command_table diff --git a/src/azure-cli/azure/cli/command_modules/network/_actions.py b/src/azure-cli/azure/cli/command_modules/network/_actions.py index ab645da8c08..3167c4facd9 100644 --- a/src/azure-cli/azure/cli/command_modules/network/_actions.py +++ b/src/azure-cli/azure/cli/command_modules/network/_actions.py @@ -15,7 +15,7 @@ class AddBackendAddressCreate(argparse._AppendAction): def __call__(self, parser, namespace, values, option_string=None): action = self.get_action(values, option_string) - super(AddBackendAddressCreate, self).__call__(parser, namespace, action, option_string) + super().__call__(parser, namespace, action, option_string) def get_action(self, values, option_string): # pylint: disable=no-self-use try: @@ -43,7 +43,7 @@ def get_action(self, values, option_string): # pylint: disable=no-self-use class AddBackendAddressCreateForCrossRegionLB(argparse._AppendAction): def __call__(self, parser, namespace, values, option_string=None): action = self.get_action(values, option_string) - super(AddBackendAddressCreateForCrossRegionLB, self).__call__(parser, namespace, action, option_string) + super().__call__(parser, namespace, action, option_string) def get_action(self, values, option_string): # pylint: disable=no-self-use try: @@ -69,7 +69,7 @@ def get_action(self, values, option_string): # pylint: disable=no-self-use class TrustedClientCertificateCreate(argparse._AppendAction): def __call__(self, parser, namespace, values, option_string=None): action = self.get_action(values, option_string) - super(TrustedClientCertificateCreate, self).__call__(parser, namespace, action, option_string) + super().__call__(parser, namespace, action, option_string) def get_action(self, values, option_string): # pylint: disable=no-self-use try: @@ -99,7 +99,7 @@ def _split(param): class SslProfilesCreate(argparse._AppendAction): def __call__(self, parser, namespace, values, option_string=None): action = self.get_action(values, option_string) - super(SslProfilesCreate, self).__call__(parser, namespace, action, option_string) + super().__call__(parser, namespace, action, option_string) def get_action(self, values, option_string): # pylint: disable=no-self-use try: @@ -163,7 +163,7 @@ def get_action(self, values, option_string): # pylint: disable=no-self-use class WAFRulesCreate(argparse._AppendAction): def __call__(self, parser, namespace, values, option_string=None): action = self.get_action(values, option_string) - super(WAFRulesCreate, self).__call__(parser, namespace, action, option_string) + super().__call__(parser, namespace, action, option_string) def get_action(self, values, option_string): # pylint: disable=no-self-use try: diff --git a/src/azure-cli/azure/cli/command_modules/network/tests/latest/test_network_commands.py b/src/azure-cli/azure/cli/command_modules/network/tests/latest/test_network_commands.py index 5fca0a2134b..916a413c6c7 100644 --- a/src/azure-cli/azure/cli/command_modules/network/tests/latest/test_network_commands.py +++ b/src/azure-cli/azure/cli/command_modules/network/tests/latest/test_network_commands.py @@ -5907,7 +5907,7 @@ class NetworkActiveActiveVnetScenarioTest(ScenarioTest): # pylint: disable=too- def __init__(self, method_name): self.sas_replacer = StorageAccountSASReplacer() - super(NetworkActiveActiveVnetScenarioTest, self).__init__(method_name, recording_processors=[ + super().__init__(method_name, recording_processors=[ self.sas_replacer ]) @@ -5981,7 +5981,7 @@ class NetworkVpnGatewayScenarioTest(ScenarioTest): def __init__(self, method_name): self.sas_replacer = StorageAccountSASReplacer() - super(NetworkVpnGatewayScenarioTest, self).__init__(method_name, recording_processors=[ + super().__init__(method_name, recording_processors=[ self.sas_replacer ]) @@ -6673,7 +6673,7 @@ def test_network_vnet_gateway_nat_rule_sub_cmd(self, resource_group): class NetworkSecurityPartnerProviderScenarioTest(ScenarioTest): def __init__(self, method_name, config_file=None, recording_dir=None, recording_name=None, recording_processors=None, replay_processors=None, recording_patches=None, replay_patches=None): - super(NetworkSecurityPartnerProviderScenarioTest, self).__init__(method_name) + super().__init__(method_name) self.cmd('extension add -n virtual-wan') @unittest.skip('Decouple with virtual-wan bump API version') @@ -6713,13 +6713,13 @@ def test_network_security_partner_provider(self): class NetworkVirtualApplianceScenarioTest(ScenarioTest): def setUp(self): - super(NetworkVirtualApplianceScenarioTest, self).setUp() + super().setUp() self.cmd('extension add -n virtual-wan') def tearDown(self): # avoid influence other test when parallel run # self.cmd('extension remove -n virtual-wan') - super(NetworkVirtualApplianceScenarioTest, self).tearDown() + super().tearDown() @unittest.skip('GatewayError') @ResourceGroupPreparer(location='westcentralus', name_prefix='test_network_virtual_appliance') diff --git a/src/azure-cli/azure/cli/command_modules/policyinsights/__init__.py b/src/azure-cli/azure/cli/command_modules/policyinsights/__init__.py index 54898803979..b48c997cf5d 100644 --- a/src/azure-cli/azure/cli/command_modules/policyinsights/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/policyinsights/__init__.py @@ -20,7 +20,7 @@ def __init__(self, cli_ctx=None): operations_tmpl='azure.cli.command_modules.policyinsights.custom#{}', exception_handler=policy_insights_exception_handler) - super(PolicyInsightsCommandsLoader, self).__init__( + super().__init__( cli_ctx=cli_ctx, resource_type=ResourceType.MGMT_POLICYINSIGHTS, custom_command_type=policyinsights_custom) diff --git a/src/azure-cli/azure/cli/command_modules/privatedns/__init__.py b/src/azure-cli/azure/cli/command_modules/privatedns/__init__.py index 8240799442d..ba88e0895c2 100644 --- a/src/azure-cli/azure/cli/command_modules/privatedns/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/privatedns/__init__.py @@ -3,8 +3,6 @@ # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- -# pylint: disable=line-too-long - from azure.cli.core import AzCommandsLoader from azure.cli.core.profiles import ResourceType @@ -17,13 +15,14 @@ def __init__(self, cli_ctx=None): from azure.cli.core import ModExtensionSuppress from azure.cli.core.commands import CliCommandType privatedns_custom = CliCommandType(operations_tmpl='azure.cli.command_modules.privatedns.custom#{}') - super(PrivateDnsCommandsLoader, self).__init__(cli_ctx=cli_ctx, - resource_type=ResourceType.MGMT_NETWORK_PRIVATEDNS, - custom_command_type=privatedns_custom, - suppress_extension=[ - ModExtensionSuppress(__name__, 'privatedns', '0.1.1', - reason='These commands are now in the CLI.', - recommend_remove=True)]) + super().__init__(cli_ctx=cli_ctx, + resource_type=ResourceType.MGMT_NETWORK_PRIVATEDNS, + custom_command_type=privatedns_custom, + suppress_extension=[ + ModExtensionSuppress( + __name__, 'privatedns', '0.1.1', + reason='These commands are now in the CLI.', + recommend_remove=True)]) def load_command_table(self, args): from azure.cli.command_modules.privatedns.commands import load_command_table diff --git a/src/azure-cli/azure/cli/command_modules/profile/__init__.py b/src/azure-cli/azure/cli/command_modules/profile/__init__.py index 4df9e6d23a6..76cb7a3f42b 100644 --- a/src/azure-cli/azure/cli/command_modules/profile/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/profile/__init__.py @@ -18,7 +18,7 @@ class ProfileCommandsLoader(AzCommandsLoader): def __init__(self, cli_ctx=None): - super(ProfileCommandsLoader, self).__init__(cli_ctx=cli_ctx) + super().__init__(cli_ctx=cli_ctx) def load_command_table(self, args): diff --git a/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/test_rdbms_commands.py b/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/test_rdbms_commands.py index 8542cce9e11..ba2b64327f6 100644 --- a/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/test_rdbms_commands.py +++ b/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/test_rdbms_commands.py @@ -35,7 +35,7 @@ def __init__(self, engine_type='mysql', engine_parameter_name='database_engine', admin_user='cloudsa', admin_password='SecretPassword123', resource_group_parameter_name='resource_group', skip_delete=True, sku_name='GP_Gen5_2'): - super(ServerPreparer, self).__init__(name_prefix, SERVER_NAME_MAX_LENGTH) + super().__init__(name_prefix, SERVER_NAME_MAX_LENGTH) from azure.cli.core.mock import DummyCli self.cli_ctx = DummyCli() self.engine_type = engine_type diff --git a/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py b/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py index 1ccb64976f2..059e3c4f6a1 100644 --- a/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py +++ b/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py @@ -42,7 +42,7 @@ class ServerPreparer(AbstractPreparer, SingleValueReplacer): def __init__(self, engine_type, location, engine_parameter_name='database_engine', name_prefix=SERVER_NAME_PREFIX, parameter_name='server', resource_group_parameter_name='resource_group'): - super(ServerPreparer, self).__init__(name_prefix, SERVER_NAME_MAX_LENGTH) + super().__init__(name_prefix, SERVER_NAME_MAX_LENGTH) from azure.cli.core.mock import DummyCli self.cli_ctx = DummyCli() self.engine_type = engine_type diff --git a/src/azure-cli/azure/cli/command_modules/redis/__init__.py b/src/azure-cli/azure/cli/command_modules/redis/__init__.py index 2a7576fcb74..94305c10a90 100644 --- a/src/azure-cli/azure/cli/command_modules/redis/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/redis/__init__.py @@ -17,9 +17,9 @@ def __init__(self, cli_ctx=None): redis_custom = CliCommandType( operations_tmpl='azure.cli.command_modules.redis.custom#{}', client_factory=cf_redis) - super(RedisCommandsLoader, self).__init__(cli_ctx=cli_ctx, - resource_type=ResourceType.MGMT_REDIS, - custom_command_type=redis_custom) + super().__init__(cli_ctx=cli_ctx, + resource_type=ResourceType.MGMT_REDIS, + custom_command_type=redis_custom) def load_command_table(self, args): from azure.cli.command_modules.redis.commands import load_command_table diff --git a/src/azure-cli/azure/cli/command_modules/redis/_validators.py b/src/azure-cli/azure/cli/command_modules/redis/_validators.py index 8d3253c5809..1382270e402 100644 --- a/src/azure-cli/azure/cli/command_modules/redis/_validators.py +++ b/src/azure-cli/azure/cli/command_modules/redis/_validators.py @@ -8,7 +8,7 @@ class JsonString(dict): def __init__(self, value): - super(JsonString, self).__init__() + super().__init__() if value[0] in ("'", '"') and value[-1] == value[0]: # Remove leading and trailing quotes for dos/cmd.exe users value = value[1:-1] @@ -18,7 +18,7 @@ def __init__(self, value): class ScheduleEntryList(list): def __init__(self, value): - super(ScheduleEntryList, self).__init__() + super().__init__() from azure.mgmt.redis.models import ScheduleEntry diff --git a/src/azure-cli/azure/cli/command_modules/relay/__init__.py b/src/azure-cli/azure/cli/command_modules/relay/__init__.py index d1109cbc960..0e37d83c06e 100644 --- a/src/azure-cli/azure/cli/command_modules/relay/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/relay/__init__.py @@ -15,7 +15,7 @@ class RelayCommandsLoader(AzCommandsLoader): def __init__(self, cli_ctx=None): from azure.cli.core.commands import CliCommandType relay_custom = CliCommandType(operations_tmpl='azure.cli.command_modules.relay.custom#{}') - super(RelayCommandsLoader, self).__init__( + super().__init__( cli_ctx=cli_ctx, custom_command_type=relay_custom) def load_command_table(self, args): diff --git a/src/azure-cli/azure/cli/command_modules/resource/__init__.py b/src/azure-cli/azure/cli/command_modules/resource/__init__.py index b74a6f7cc2a..cd5159f853f 100644 --- a/src/azure-cli/azure/cli/command_modules/resource/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/resource/__init__.py @@ -15,13 +15,13 @@ def __init__(self, cli_ctx=None): from azure.cli.core import ModExtensionSuppress from azure.cli.core.profiles import ResourceType resource_custom = CliCommandType(operations_tmpl='azure.cli.command_modules.resource.custom#{}') - super(ResourceCommandsLoader, self).__init__(cli_ctx=cli_ctx, - resource_type=ResourceType.MGMT_RESOURCE_RESOURCES, - custom_command_type=resource_custom, - suppress_extension=ModExtensionSuppress( - __name__, 'managementgroups', '0.1.0', - reason='The management groups commands are now in CLI.', - recommend_remove=True)) + super().__init__(cli_ctx=cli_ctx, + resource_type=ResourceType.MGMT_RESOURCE_RESOURCES, + custom_command_type=resource_custom, + suppress_extension=ModExtensionSuppress( + __name__, 'managementgroups', '0.1.0', + reason='The management groups commands are now in CLI.', + recommend_remove=True)) def load_command_table(self, args): from azure.cli.command_modules.resource.commands import load_command_table diff --git a/src/azure-cli/azure/cli/command_modules/role/__init__.py b/src/azure-cli/azure/cli/command_modules/role/__init__.py index 6681477980e..65fe29dc7a5 100644 --- a/src/azure-cli/azure/cli/command_modules/role/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/role/__init__.py @@ -15,10 +15,10 @@ class RoleCommandsLoader(AzCommandsLoader): def __init__(self, cli_ctx=None): from azure.cli.core.commands import CliCommandType role_custom = CliCommandType(operations_tmpl='azure.cli.command_modules.role.custom#{}') - super(RoleCommandsLoader, self).__init__(cli_ctx=cli_ctx, - resource_type=ResourceType.MGMT_AUTHORIZATION, - operation_group='role_assignments', - custom_command_type=role_custom) + super().__init__(cli_ctx=cli_ctx, + resource_type=ResourceType.MGMT_AUTHORIZATION, + operation_group='role_assignments', + custom_command_type=role_custom) def load_command_table(self, args): from azure.cli.command_modules.role.commands import load_command_table diff --git a/src/azure-cli/azure/cli/command_modules/search/__init__.py b/src/azure-cli/azure/cli/command_modules/search/__init__.py index 7cdebba334b..87eaf4edac0 100644 --- a/src/azure-cli/azure/cli/command_modules/search/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/search/__init__.py @@ -15,9 +15,9 @@ def __init__(self, cli_ctx=None): from azure.cli.core.profiles import ResourceType azure_search_custom = CliCommandType(operations_tmpl='azure.cli.command_modules.search.custom#{}') - super(AzureSearchCommandsLoader, self).__init__(cli_ctx=cli_ctx, - resource_type=ResourceType.MGMT_SEARCH, - custom_command_type=azure_search_custom) + super().__init__(cli_ctx=cli_ctx, + resource_type=ResourceType.MGMT_SEARCH, + custom_command_type=azure_search_custom) def load_command_table(self, args): from azure.cli.command_modules.search.commands import load_command_table diff --git a/src/azure-cli/azure/cli/command_modules/search/tests/latest/test_admin_key.py b/src/azure-cli/azure/cli/command_modules/search/tests/latest/test_admin_key.py index 66648afa724..7f9efb8eb0d 100644 --- a/src/azure-cli/azure/cli/command_modules/search/tests/latest/test_admin_key.py +++ b/src/azure-cli/azure/cli/command_modules/search/tests/latest/test_admin_key.py @@ -12,7 +12,7 @@ class AzureSearchAdminKeysTests(ScenarioTest): # https://vcrpy.readthedocs.io/en/latest/configuration.html#request-matching def setUp(self): self.vcr.match_on = ['scheme', 'method', 'path', 'query'] # not 'host', 'port' - super(AzureSearchAdminKeysTests, self).setUp() + super().setUp() @ResourceGroupPreparer(name_prefix='azure_search_cli_test', location='eastus2euap') def test_admin_key_show_renew(self, resource_group): diff --git a/src/azure-cli/azure/cli/command_modules/search/tests/latest/test_private_endpoint_connection.py b/src/azure-cli/azure/cli/command_modules/search/tests/latest/test_private_endpoint_connection.py index e262529bdb0..69a9ddc0c19 100644 --- a/src/azure-cli/azure/cli/command_modules/search/tests/latest/test_private_endpoint_connection.py +++ b/src/azure-cli/azure/cli/command_modules/search/tests/latest/test_private_endpoint_connection.py @@ -12,7 +12,7 @@ class AzureSearchServicesTests(ScenarioTest): # https://vcrpy.readthedocs.io/en/latest/configuration.html#request-matching def setUp(self): self.vcr.match_on = ['scheme', 'method', 'path', 'query'] # not 'host', 'port' - super(AzureSearchServicesTests, self).setUp() + super().setUp() @ResourceGroupPreparer(name_prefix='azure_search_cli_test', location='eastus2euap') def test_private_endpoint_connection_crud(self, resource_group): diff --git a/src/azure-cli/azure/cli/command_modules/search/tests/latest/test_private_link_resources.py b/src/azure-cli/azure/cli/command_modules/search/tests/latest/test_private_link_resources.py index f96742b49a3..0de7a255c07 100644 --- a/src/azure-cli/azure/cli/command_modules/search/tests/latest/test_private_link_resources.py +++ b/src/azure-cli/azure/cli/command_modules/search/tests/latest/test_private_link_resources.py @@ -12,7 +12,7 @@ class AzureSearchServicesTests(ScenarioTest): # https://vcrpy.readthedocs.io/en/latest/configuration.html#request-matching def setUp(self): self.vcr.match_on = ['scheme', 'method', 'path', 'query'] # not 'host', 'port' - super(AzureSearchServicesTests, self).setUp() + super().setUp() @ResourceGroupPreparer(name_prefix='azure_search_cli_test', location='eastus2euap') def test_list_private_link_resources(self, resource_group): diff --git a/src/azure-cli/azure/cli/command_modules/search/tests/latest/test_query_key.py b/src/azure-cli/azure/cli/command_modules/search/tests/latest/test_query_key.py index 767b88c7560..3dcfe58d33a 100644 --- a/src/azure-cli/azure/cli/command_modules/search/tests/latest/test_query_key.py +++ b/src/azure-cli/azure/cli/command_modules/search/tests/latest/test_query_key.py @@ -12,7 +12,7 @@ class AzureSearchQueryKeysTests(ScenarioTest): # https://vcrpy.readthedocs.io/en/latest/configuration.html#request-matching def setUp(self): self.vcr.match_on = ['scheme', 'method', 'path', 'query'] # not 'host', 'port' - super(AzureSearchQueryKeysTests, self).setUp() + super().setUp() @ResourceGroupPreparer(name_prefix='azure_search_cli_test', location='eastus2euap') def test_query_key_create_delete_list(self, resource_group): diff --git a/src/azure-cli/azure/cli/command_modules/search/tests/latest/test_service.py b/src/azure-cli/azure/cli/command_modules/search/tests/latest/test_service.py index e08087b3bf6..e37dda155ad 100644 --- a/src/azure-cli/azure/cli/command_modules/search/tests/latest/test_service.py +++ b/src/azure-cli/azure/cli/command_modules/search/tests/latest/test_service.py @@ -12,7 +12,7 @@ class AzureSearchServicesTests(ScenarioTest): # https://vcrpy.readthedocs.io/en/latest/configuration.html#request-matching def setUp(self): self.vcr.match_on = ['scheme', 'method', 'path', 'query'] # not 'host', 'port' - super(AzureSearchServicesTests, self).setUp() + super().setUp() @ResourceGroupPreparer(name_prefix='azure_search_cli_test', location='westcentralus') def test_service_create_skus(self, resource_group): diff --git a/src/azure-cli/azure/cli/command_modules/search/tests/latest/test_shared_private_link_resource.py b/src/azure-cli/azure/cli/command_modules/search/tests/latest/test_shared_private_link_resource.py index ce5ef6f9911..300a007565e 100644 --- a/src/azure-cli/azure/cli/command_modules/search/tests/latest/test_shared_private_link_resource.py +++ b/src/azure-cli/azure/cli/command_modules/search/tests/latest/test_shared_private_link_resource.py @@ -12,7 +12,7 @@ class AzureSearchServicesTests(ScenarioTest): # https://vcrpy.readthedocs.io/en/latest/configuration.html#request-matching def setUp(self): self.vcr.match_on = ['scheme', 'method', 'path', 'query'] # not 'host', 'port' - super(AzureSearchServicesTests, self).setUp() + super().setUp() @ResourceGroupPreparer(name_prefix='azure_search_cli_test', location='westcentralus') @StorageAccountPreparer(name_prefix='satest', kind='StorageV2') diff --git a/src/azure-cli/azure/cli/command_modules/security/__init__.py b/src/azure-cli/azure/cli/command_modules/security/__init__.py index bbd623ccfb0..de5083f6f01 100644 --- a/src/azure-cli/azure/cli/command_modules/security/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/security/__init__.py @@ -15,7 +15,7 @@ def __init__(self, cli_ctx=None): security_custom = CliCommandType( operations_tmpl='azure.cli.command_modules.security.custom#{}') - super(SecurityCommandsLoader, self).__init__( + super().__init__( cli_ctx=cli_ctx, custom_command_type=security_custom) diff --git a/src/azure-cli/azure/cli/command_modules/security/actions.py b/src/azure-cli/azure/cli/command_modules/security/actions.py index bbc28d00da7..ec558025eac 100644 --- a/src/azure-cli/azure/cli/command_modules/security/actions.py +++ b/src/azure-cli/azure/cli/command_modules/security/actions.py @@ -31,7 +31,7 @@ def __init__(self, 'the append const action may be more appropriate') if const is not None and nargs != OPTIONAL: raise ValueError('nargs must be %r to supply const' % OPTIONAL) - super(_AppendToDictionaryAction, self).__init__( + super().__init__( option_strings=option_strings, dest=dest, nargs=nargs, @@ -62,7 +62,7 @@ class AppendBaseline(argparse._AppendAction): def __call__(self, parser, namespace, values, option_string=None): try: - super(AppendBaseline, self).__call__(parser, namespace, values, option_string) + super().__call__(parser, namespace, values, option_string) except ValueError: raise CLIInternalError("Unexpected error") @@ -74,7 +74,7 @@ def __call__(self, parser, namespace, values, option_string=None): try: rule_id = _get_rule_id(values[0]) baseline_row_values = values[1:] - super(AppendBaselines, self).__call__(parser, namespace, (rule_id, baseline_row_values), option_string) + super().__call__(parser, namespace, (rule_id, baseline_row_values), option_string) except ValueError: raise CLIInternalError("Unexpected error") @@ -93,7 +93,7 @@ class GetExtension(argparse._AppendAction): def __call__(self, parser, namespace, values, option_string=None): action = self.get_action(values, option_string) - super(GetExtension, self).__call__(parser, namespace, action, option_string) + super().__call__(parser, namespace, action, option_string) def get_action(self, values, option_string): # pylint: disable=no-self-use try: diff --git a/src/azure-cli/azure/cli/command_modules/security/tests/latest/preparers.py b/src/azure-cli/azure/cli/command_modules/security/tests/latest/preparers.py index 0837898071c..04de4cdcd20 100644 --- a/src/azure-cli/azure/cli/command_modules/security/tests/latest/preparers.py +++ b/src/azure-cli/azure/cli/command_modules/security/tests/latest/preparers.py @@ -21,7 +21,7 @@ class SqlVirtualMachinePreparer(AbstractPreparer, SingleValueReplacer): def __init__(self, name_prefix=sqlvm_name_prefix, location='eastus2euap', vm_user='admin123', vm_password='SecretPassword123', parameter_name='sqlvm', resource_group_parameter_name='resource_group', skip_delete=False): - super(SqlVirtualMachinePreparer, self).__init__(name_prefix, sqlvm_max_length) + super().__init__(name_prefix, sqlvm_max_length) self.location = location self.parameter_name = parameter_name self.vm_user = vm_user diff --git a/src/azure-cli/azure/cli/command_modules/servicebus/__init__.py b/src/azure-cli/azure/cli/command_modules/servicebus/__init__.py index 8e55affecb4..bf6fffbf2c9 100644 --- a/src/azure-cli/azure/cli/command_modules/servicebus/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/servicebus/__init__.py @@ -4,7 +4,6 @@ # -------------------------------------------------------------------------------------------- # pylint: disable=unused-import -# pylint: disable=line-too-long from azure.cli.core import AzCommandsLoader from azure.cli.command_modules.servicebus._help import helps @@ -17,11 +16,11 @@ def __init__(self, cli_ctx=None): from azure.cli.core.commands import CliCommandType from azure.cli.core.profiles import ResourceType servicebus_custom = CliCommandType(operations_tmpl='azure.cli.command_modules.servicebus.custom#{}') - super(ServicebusCommandsLoader, self).__init__(cli_ctx=cli_ctx, custom_command_type=servicebus_custom, - resource_type=ResourceType.MGMT_SERVICEBUS, - suppress_extension=ModExtensionSuppress(__name__, 'servicebus', '0.0.1', - reason='These commands are now in the CLI.', - recommend_remove=True)) + super().__init__(cli_ctx=cli_ctx, custom_command_type=servicebus_custom, + resource_type=ResourceType.MGMT_SERVICEBUS, + suppress_extension=ModExtensionSuppress(__name__, 'servicebus', '0.0.1', + reason='These commands are now in the CLI.', + recommend_remove=True)) def load_command_table(self, args): from azure.cli.command_modules.servicebus.commands import load_command_table diff --git a/src/azure-cli/azure/cli/command_modules/servicebus/action.py b/src/azure-cli/azure/cli/command_modules/servicebus/action.py index 4bb38216392..c9dde38bf3c 100644 --- a/src/azure-cli/azure/cli/command_modules/servicebus/action.py +++ b/src/azure-cli/azure/cli/command_modules/servicebus/action.py @@ -14,7 +14,7 @@ class AlertAddEncryption(argparse._AppendAction): def __call__(self, parser, namespace, values, option_string=None): action = self.get_action(values, option_string) - super(AlertAddEncryption, self).__call__(parser, namespace, action, option_string) + super().__call__(parser, namespace, action, option_string) def get_action(self, values, option_string): from azure.cli.core.azclierror import InvalidArgumentValueError @@ -52,7 +52,7 @@ def get_action(self, values, option_string): class AlertAddVirtualNetwork(argparse._AppendAction): def __call__(self, parser, namespace, values, option_string=None): action = self.get_action(values, option_string) - super(AlertAddVirtualNetwork, self).__call__(parser, namespace, action, option_string) + super().__call__(parser, namespace, action, option_string) def get_action(self, values, option_string): # pylint: disable=no-self-use from azure.cli.core import CLIError @@ -78,7 +78,7 @@ def get_action(self, values, option_string): # pylint: disable=no-self-use class AlertAddIpRule(argparse._AppendAction): def __call__(self, parser, namespace, values, option_string=None): action = self.get_action(values, option_string) - super(AlertAddIpRule, self).__call__(parser, namespace, action, option_string) + super().__call__(parser, namespace, action, option_string) def get_action(self, values, option_string): # pylint: disable=no-self-use from azure.cli.core import CLIError @@ -104,7 +104,7 @@ def get_action(self, values, option_string): # pylint: disable=no-self-use class AlertAddlocation(argparse._AppendAction): def __call__(self, parser, namespace, values, option_string=None): action = self.get_action(values, option_string) - super(AlertAddlocation, self).__call__(parser, namespace, action, option_string) + super().__call__(parser, namespace, action, option_string) def get_action(self, values, option_string): # pylint: disable=no-self-use from azure.cli.core import CLIError diff --git a/src/azure-cli/azure/cli/command_modules/serviceconnector/__init__.py b/src/azure-cli/azure/cli/command_modules/serviceconnector/__init__.py index 64f6ae25e73..7c9b6f68f4e 100644 --- a/src/azure-cli/azure/cli/command_modules/serviceconnector/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/serviceconnector/__init__.py @@ -15,8 +15,7 @@ def __init__(self, cli_ctx=None): connection_custom = CliCommandType( operations_tmpl='azure.cli.command_modules.serviceconnector.custom#{}', client_factory=cf_connection_cl) - parent = super(MicrosoftServiceConnectorCommandsLoader, self) - parent.__init__(cli_ctx=cli_ctx, custom_command_type=connection_custom) + super().__init__(cli_ctx=cli_ctx, custom_command_type=connection_custom) def load_command_table(self, args): from azure.cli.command_modules.serviceconnector.commands import load_command_table as load_command_table_manual diff --git a/src/azure-cli/azure/cli/command_modules/serviceconnector/tests/latest/test_containerapp_connection_scenario.py b/src/azure-cli/azure/cli/command_modules/serviceconnector/tests/latest/test_containerapp_connection_scenario.py index 5019d5e37d1..118f822fb2d 100644 --- a/src/azure-cli/azure/cli/command_modules/serviceconnector/tests/latest/test_containerapp_connection_scenario.py +++ b/src/azure-cli/azure/cli/command_modules/serviceconnector/tests/latest/test_containerapp_connection_scenario.py @@ -24,7 +24,7 @@ class ContainerAppConnectionScenarioTest(ScenarioTest): default_container_name = 'simple-hello-world-container' def __init__(self, method_name): - super(ContainerAppConnectionScenarioTest, self).__init__( + super().__init__( method_name, recording_processors=[CredentialReplacer(), ConfigCredentialReplacer()] ) diff --git a/src/azure-cli/azure/cli/command_modules/serviceconnector/tests/latest/test_kubernetes_connection_scenario.py b/src/azure-cli/azure/cli/command_modules/serviceconnector/tests/latest/test_kubernetes_connection_scenario.py index b91c171beab..80e6dc7472e 100644 --- a/src/azure-cli/azure/cli/command_modules/serviceconnector/tests/latest/test_kubernetes_connection_scenario.py +++ b/src/azure-cli/azure/cli/command_modules/serviceconnector/tests/latest/test_kubernetes_connection_scenario.py @@ -23,7 +23,7 @@ class KubernetesConnectionScenarioTest(ScenarioTest): def __init__(self, method_name): - super(KubernetesConnectionScenarioTest, self).__init__( + super().__init__( method_name, recording_processors=[CredentialReplacer(), ConfigCredentialReplacer()] ) diff --git a/src/azure-cli/azure/cli/command_modules/serviceconnector/tests/latest/test_local_connection_scenario.py b/src/azure-cli/azure/cli/command_modules/serviceconnector/tests/latest/test_local_connection_scenario.py index 3d23ccdbcdb..9d4071c8728 100644 --- a/src/azure-cli/azure/cli/command_modules/serviceconnector/tests/latest/test_local_connection_scenario.py +++ b/src/azure-cli/azure/cli/command_modules/serviceconnector/tests/latest/test_local_connection_scenario.py @@ -25,7 +25,7 @@ class LocalConnectionScenarioTest(ScenarioTest): def __init__(self, method_name): - super(LocalConnectionScenarioTest, self).__init__( + super().__init__( method_name, recording_processors=[CredentialReplacer(), ConfigCredentialReplacer()] ) diff --git a/src/azure-cli/azure/cli/command_modules/serviceconnector/tests/latest/test_passwordless_connection_scenario.py b/src/azure-cli/azure/cli/command_modules/serviceconnector/tests/latest/test_passwordless_connection_scenario.py index b06f065f462..77c5a26d7c1 100644 --- a/src/azure-cli/azure/cli/command_modules/serviceconnector/tests/latest/test_passwordless_connection_scenario.py +++ b/src/azure-cli/azure/cli/command_modules/serviceconnector/tests/latest/test_passwordless_connection_scenario.py @@ -21,7 +21,7 @@ class PasswordlessConnectionScenarioTest(ScenarioTest): def __init__(self, method_name): - super(PasswordlessConnectionScenarioTest, self).__init__( + super().__init__( method_name, recording_processors=[CredentialReplacer()] ) diff --git a/src/azure-cli/azure/cli/command_modules/serviceconnector/tests/latest/test_springboot_cosmossql_scenario.py b/src/azure-cli/azure/cli/command_modules/serviceconnector/tests/latest/test_springboot_cosmossql_scenario.py index cf2271c5b21..ab89160c45b 100644 --- a/src/azure-cli/azure/cli/command_modules/serviceconnector/tests/latest/test_springboot_cosmossql_scenario.py +++ b/src/azure-cli/azure/cli/command_modules/serviceconnector/tests/latest/test_springboot_cosmossql_scenario.py @@ -22,7 +22,7 @@ class SpringBootCosmosSqlScenarioTest(ScenarioTest): def __init__(self, method_name): - super(SpringBootCosmosSqlScenarioTest, self).__init__( + super().__init__( method_name, recording_processors=[CredentialReplacer(), ConfigCredentialReplacer()] ) diff --git a/src/azure-cli/azure/cli/command_modules/serviceconnector/tests/latest/test_springcloud_connection_scenario.py b/src/azure-cli/azure/cli/command_modules/serviceconnector/tests/latest/test_springcloud_connection_scenario.py index e44a6016564..13551c5df0c 100644 --- a/src/azure-cli/azure/cli/command_modules/serviceconnector/tests/latest/test_springcloud_connection_scenario.py +++ b/src/azure-cli/azure/cli/command_modules/serviceconnector/tests/latest/test_springcloud_connection_scenario.py @@ -22,7 +22,7 @@ class SpringCloudConnectionScenarioTest(ScenarioTest): def __init__(self, method_name): - super(SpringCloudConnectionScenarioTest, self).__init__( + super().__init__( method_name, recording_processors=[CredentialReplacer(), ConfigCredentialReplacer()] ) diff --git a/src/azure-cli/azure/cli/command_modules/serviceconnector/tests/latest/test_webapp_addon_scenario.py b/src/azure-cli/azure/cli/command_modules/serviceconnector/tests/latest/test_webapp_addon_scenario.py index a6e6adf6184..88bc7aa4d13 100644 --- a/src/azure-cli/azure/cli/command_modules/serviceconnector/tests/latest/test_webapp_addon_scenario.py +++ b/src/azure-cli/azure/cli/command_modules/serviceconnector/tests/latest/test_webapp_addon_scenario.py @@ -17,7 +17,7 @@ class WebAppAddonScenarioTest(ScenarioTest): def __init__(self, method_name): - super(WebAppAddonScenarioTest, self).__init__( + super().__init__( method_name, recording_processors=[CredentialReplacer(), ConfigCredentialReplacer()] ) diff --git a/src/azure-cli/azure/cli/command_modules/serviceconnector/tests/latest/test_webpp_connection_scenario.py b/src/azure-cli/azure/cli/command_modules/serviceconnector/tests/latest/test_webpp_connection_scenario.py index 90b67a4cfea..2c6f64eff3c 100644 --- a/src/azure-cli/azure/cli/command_modules/serviceconnector/tests/latest/test_webpp_connection_scenario.py +++ b/src/azure-cli/azure/cli/command_modules/serviceconnector/tests/latest/test_webpp_connection_scenario.py @@ -21,7 +21,7 @@ class WebAppConnectionScenarioTest(ScenarioTest): def __init__(self, method_name): - super(WebAppConnectionScenarioTest, self).__init__( + super().__init__( method_name, recording_processors=[CredentialReplacer(), ConfigCredentialReplacer()] ) diff --git a/src/azure-cli/azure/cli/command_modules/servicefabric/__init__.py b/src/azure-cli/azure/cli/command_modules/servicefabric/__init__.py index a0097ac7d9a..22cfd04796c 100644 --- a/src/azure-cli/azure/cli/command_modules/servicefabric/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/servicefabric/__init__.py @@ -14,9 +14,9 @@ def __init__(self, cli_ctx=None): from azure.cli.core.commands import CliCommandType from azure.cli.core.profiles import ResourceType sf_custom = CliCommandType(operations_tmpl='azure.cli.command_modules.servicefabric.custom#{}') - super(ServiceFabricCommandsLoader, self).__init__(cli_ctx=cli_ctx, - custom_command_type=sf_custom, - resource_type=ResourceType.MGMT_SERVICEFABRIC) + super().__init__(cli_ctx=cli_ctx, + custom_command_type=sf_custom, + resource_type=ResourceType.MGMT_SERVICEFABRIC) def load_command_table(self, args): from azure.cli.command_modules.servicefabric.commands import load_command_table diff --git a/src/azure-cli/azure/cli/command_modules/signalr/__init__.py b/src/azure-cli/azure/cli/command_modules/signalr/__init__.py index baf8343994b..909c20efb89 100644 --- a/src/azure-cli/azure/cli/command_modules/signalr/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/signalr/__init__.py @@ -12,8 +12,7 @@ class SignalRCommandsLoader(AzCommandsLoader): def __init__(self, cli_ctx=None): from azure.cli.core.profiles import ResourceType - super(SignalRCommandsLoader, self).__init__(cli_ctx=cli_ctx, - resource_type=ResourceType.MGMT_SIGNALR) + super().__init__(cli_ctx=cli_ctx, resource_type=ResourceType.MGMT_SIGNALR) def load_command_table(self, args): from .commands import load_command_table diff --git a/src/azure-cli/azure/cli/command_modules/sql/__init__.py b/src/azure-cli/azure/cli/command_modules/sql/__init__.py index 439663b57de..4c3bf9a3faa 100644 --- a/src/azure-cli/azure/cli/command_modules/sql/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/sql/__init__.py @@ -14,9 +14,9 @@ def __init__(self, cli_ctx=None): from azure.cli.core.commands import CliCommandType from azure.cli.core.profiles import ResourceType sql_custom = CliCommandType(operations_tmpl='azure.cli.command_modules.sql.custom#{}') - super(SqlCommandsLoader, self).__init__(cli_ctx=cli_ctx, - custom_command_type=sql_custom, - resource_type=ResourceType.MGMT_SQL) + super().__init__(cli_ctx=cli_ctx, + custom_command_type=sql_custom, + resource_type=ResourceType.MGMT_SQL) def load_command_table(self, args): from azure.cli.command_modules.sql.commands import load_command_table diff --git a/src/azure-cli/azure/cli/command_modules/sql/_format.py b/src/azure-cli/azure/cli/command_modules/sql/_format.py index 45bc313f937..b6266452aef 100644 --- a/src/azure-cli/azure/cli/command_modules/sql/_format.py +++ b/src/azure-cli/azure/cli/command_modules/sql/_format.py @@ -35,7 +35,7 @@ class LongRunningOperationResultTransform(LongRunningOperation): # pylint: disa Long-running operation poller that also transforms the json response. ''' def __init__(self, cli_ctx, transform_func): - super(LongRunningOperationResultTransform, self).__init__(cli_ctx) + super().__init__(cli_ctx) self._transform_func = transform_func def __call__(self, result): @@ -50,7 +50,7 @@ def __call__(self, result): from azure.cli.core.util import poller_classes if isinstance(result, poller_classes()): # Poll for long-running operation result result by calling base class - result = super(LongRunningOperationResultTransform, self).__call__(result) + result = super().__call__(result) # Apply transform function return self._transform_func(result) diff --git a/src/azure-cli/azure/cli/command_modules/sql/tests/latest/test_sql_commands.py b/src/azure-cli/azure/cli/command_modules/sql/tests/latest/test_sql_commands.py index b86859f9f9f..3fd6e4c0bb1 100644 --- a/src/azure-cli/azure/cli/command_modules/sql/tests/latest/test_sql_commands.py +++ b/src/azure-cli/azure/cli/command_modules/sql/tests/latest/test_sql_commands.py @@ -47,7 +47,7 @@ class SqlServerPreparer(AbstractPreparer, SingleValueReplacer): def __init__(self, name_prefix=server_name_prefix, parameter_name='server', location='westus', admin_user='admin123', admin_password='SecretPassword123', resource_group_parameter_name='resource_group', skip_delete=True): - super(SqlServerPreparer, self).__init__(name_prefix, server_name_max_length) + super().__init__(name_prefix, server_name_max_length) self.location = location self.parameter_name = parameter_name self.admin_user = admin_user @@ -111,7 +111,7 @@ def __init__(self, name_prefix=managed_instance_name_prefix, parameter_name='mi' minimalTlsVersion='', user_assigned_identity_id='', identity_type='', pid='', otherParams='', admin_password='SecretPassword123SecretPassword', public=True, tags='', is_geo_secondary=False, skip_delete=False, vnet_name = 'vnet-mi-tooling', v_core = 4): - super(ManagedInstancePreparer, self).__init__(name_prefix, server_name_max_length) + super().__init__(name_prefix, server_name_max_length) self.parameter_name = parameter_name self.admin_user = admin_user self.admin_password = admin_password @@ -3155,7 +3155,7 @@ def __init__(self, name, group, location): class SqlElasticPoolsMgmtScenarioTest(ScenarioTest): def __init__(self, method_name): - super(SqlElasticPoolsMgmtScenarioTest, self).__init__(method_name) + super().__init__(method_name) self.pool_name = "cliautomationpool01" def verify_activities(self, activities, resource_group, server): @@ -3729,7 +3729,7 @@ def test_sql_elastic_pools_preferred_enclave_type_mgmt(self, resource_group, res class SqlElasticPoolOperationMgmtScenarioTest(ScenarioTest): def __init__(self, method_name): - super(SqlElasticPoolOperationMgmtScenarioTest, self).__init__(method_name) + super().__init__(method_name) self.pool_name = "operationtestep1" @ResourceGroupPreparer(location='westeurope') diff --git a/src/azure-cli/azure/cli/command_modules/sqlvm/__init__.py b/src/azure-cli/azure/cli/command_modules/sqlvm/__init__.py index ca12d4b04db..1fa9103f189 100644 --- a/src/azure-cli/azure/cli/command_modules/sqlvm/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/sqlvm/__init__.py @@ -8,7 +8,6 @@ import azure.cli.command_modules.sqlvm._help # pylint: disable=unused-import -# pylint: disable=line-too-long class SqlVmCommandsLoader(AzCommandsLoader): def __init__(self, cli_ctx=None): @@ -17,12 +16,12 @@ def __init__(self, cli_ctx=None): from azure.cli.core.profiles import ResourceType sqlvm_custom = CliCommandType(operations_tmpl='azure.cli.command_modules.sqlvm.custom#{}') - super(SqlVmCommandsLoader, self).__init__(cli_ctx=cli_ctx, - custom_command_type=sqlvm_custom, - resource_type=ResourceType.MGMT_SQLVM, - suppress_extension=ModExtensionSuppress(__name__, 'sqlvm-preview', '0.1.0', - reason='These commands are now in the CLI.', - recommend_remove=True)) + super().__init__(cli_ctx=cli_ctx, + custom_command_type=sqlvm_custom, + resource_type=ResourceType.MGMT_SQLVM, + suppress_extension=ModExtensionSuppress(__name__, 'sqlvm-preview', '0.1.0', + reason='These commands are now in the CLI.', + recommend_remove=True)) def load_command_table(self, args): from azure.cli.command_modules.sqlvm.commands import load_command_table diff --git a/src/azure-cli/azure/cli/command_modules/sqlvm/tests/latest/test_sqlvm_commands.py b/src/azure-cli/azure/cli/command_modules/sqlvm/tests/latest/test_sqlvm_commands.py index b544bdee794..6c638946b84 100644 --- a/src/azure-cli/azure/cli/command_modules/sqlvm/tests/latest/test_sqlvm_commands.py +++ b/src/azure-cli/azure/cli/command_modules/sqlvm/tests/latest/test_sqlvm_commands.py @@ -36,7 +36,7 @@ def __init__(self, name_prefix=sqlvm_name_prefix, location='westus', vm_user='admin123', vm_password='SecretPassword123', parameter_name='sqlvm', resource_group_parameter_name='resource_group', skip_delete=True, image='microsoftsqlserver:sql2019-ws2022:enterprise:latest'): - super(SqlVirtualMachinePreparer, self).__init__(name_prefix, sqlvm_max_length) + super().__init__(name_prefix, sqlvm_max_length) self.location = location self.parameter_name = parameter_name self.vm_user = vm_user @@ -70,7 +70,7 @@ class DomainPreparer(AbstractPreparer, SingleValueReplacer): def __init__(self, name_prefix=sqlvm_domain_prefix, location='westus', vm_user='admin123', vm_password='SecretPassword123', parameter_name='domainvm', resource_group_parameter_name='resource_group', skip_delete=True): - super(DomainPreparer, self).__init__(name_prefix, sqlvm_max_length) + super().__init__(name_prefix, sqlvm_max_length) self.location = location self.parameter_name = parameter_name self.vm_user = vm_user diff --git a/src/azure-cli/azure/cli/command_modules/storage/__init__.py b/src/azure-cli/azure/cli/command_modules/storage/__init__.py index ca66325ab92..052cbf6db0b 100644 --- a/src/azure-cli/azure/cli/command_modules/storage/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/storage/__init__.py @@ -15,11 +15,11 @@ class StorageCommandsLoader(AzCommandsLoader): def __init__(self, cli_ctx=None): from azure.cli.core.commands import CliCommandType storage_custom = CliCommandType(operations_tmpl='azure.cli.command_modules.storage.custom#{}') - super(StorageCommandsLoader, self).__init__(cli_ctx=cli_ctx, - resource_type=ResourceType.DATA_STORAGE, - custom_command_type=storage_custom, - command_group_cls=StorageCommandGroup, - argument_context_cls=StorageArgumentContext) + super().__init__(cli_ctx=cli_ctx, + resource_type=ResourceType.DATA_STORAGE, + custom_command_type=storage_custom, + command_group_cls=StorageCommandGroup, + argument_context_cls=StorageArgumentContext) def load_command_table(self, args): from azure.cli.command_modules.storage.commands import load_command_table @@ -47,20 +47,20 @@ def __init__(self, cli_ctx=None): from azure.cli.core.commands import CliCommandType storage_custom = CliCommandType(operations_tmpl='azure.cli.command_modules.storage.custom#{}') - super(AzureStackStorageCommandsLoader, self).__init__(cli_ctx=cli_ctx, - resource_type=ResourceType.DATA_STORAGE, - custom_command_type=storage_custom, - command_group_cls=AzureStackStorageCommandGroup, - argument_context_cls=StorageArgumentContext) + super().__init__(cli_ctx=cli_ctx, + resource_type=ResourceType.DATA_STORAGE, + custom_command_type=storage_custom, + command_group_cls=AzureStackStorageCommandGroup, + argument_context_cls=StorageArgumentContext) def load_command_table(self, args): - super(AzureStackStorageCommandsLoader, self).load_command_table(args) + super().load_command_table(args) from azure.cli.command_modules.storage.commands_azure_stack import load_command_table load_command_table(self, args) return self.command_table def load_arguments(self, command): - super(AzureStackStorageCommandsLoader, self).load_arguments(command) + super().load_arguments(command) from azure.cli.command_modules.storage._params_azure_stack import load_arguments load_arguments(self, command) diff --git a/src/azure-cli/azure/cli/command_modules/storage/tests/hybrid_2018_03_01/test_storage_url_helpers.py b/src/azure-cli/azure/cli/command_modules/storage/tests/hybrid_2018_03_01/test_storage_url_helpers.py index 3b40205b4f6..e8da061abd2 100644 --- a/src/azure-cli/azure/cli/command_modules/storage/tests/hybrid_2018_03_01/test_storage_url_helpers.py +++ b/src/azure-cli/azure/cli/command_modules/storage/tests/hybrid_2018_03_01/test_storage_url_helpers.py @@ -14,8 +14,8 @@ class MockCLI(CLI): def __init__(self): - super(MockCLI, self).__init__(cli_name='mock_cli', config_dir=GLOBAL_CONFIG_DIR, - config_env_var_prefix=ENV_VAR_PREFIX) + super().__init__(cli_name='mock_cli', config_dir=GLOBAL_CONFIG_DIR, + config_env_var_prefix=ENV_VAR_PREFIX) self.cloud = get_active_cloud(self) diff --git a/src/azure-cli/azure/cli/command_modules/storage/tests/hybrid_2018_03_01/test_storage_validators.py b/src/azure-cli/azure/cli/command_modules/storage/tests/hybrid_2018_03_01/test_storage_validators.py index e7607e524c2..0f259f268dd 100644 --- a/src/azure-cli/azure/cli/command_modules/storage/tests/hybrid_2018_03_01/test_storage_validators.py +++ b/src/azure-cli/azure/cli/command_modules/storage/tests/hybrid_2018_03_01/test_storage_validators.py @@ -23,8 +23,8 @@ class MockCLI(CLI): def __init__(self): - super(MockCLI, self).__init__(cli_name='mock_cli', config_dir=GLOBAL_CONFIG_DIR, - config_env_var_prefix=ENV_VAR_PREFIX, commands_loader_cls=MockLoader) + super().__init__(cli_name='mock_cli', config_dir=GLOBAL_CONFIG_DIR, + config_env_var_prefix=ENV_VAR_PREFIX, commands_loader_cls=MockLoader) self.cloud = get_active_cloud(self) diff --git a/src/azure-cli/azure/cli/command_modules/storage/tests/hybrid_2019_03_01/test_storage_url_helpers.py b/src/azure-cli/azure/cli/command_modules/storage/tests/hybrid_2019_03_01/test_storage_url_helpers.py index 3b40205b4f6..e8da061abd2 100644 --- a/src/azure-cli/azure/cli/command_modules/storage/tests/hybrid_2019_03_01/test_storage_url_helpers.py +++ b/src/azure-cli/azure/cli/command_modules/storage/tests/hybrid_2019_03_01/test_storage_url_helpers.py @@ -14,8 +14,8 @@ class MockCLI(CLI): def __init__(self): - super(MockCLI, self).__init__(cli_name='mock_cli', config_dir=GLOBAL_CONFIG_DIR, - config_env_var_prefix=ENV_VAR_PREFIX) + super().__init__(cli_name='mock_cli', config_dir=GLOBAL_CONFIG_DIR, + config_env_var_prefix=ENV_VAR_PREFIX) self.cloud = get_active_cloud(self) diff --git a/src/azure-cli/azure/cli/command_modules/storage/tests/hybrid_2019_03_01/test_storage_validators.py b/src/azure-cli/azure/cli/command_modules/storage/tests/hybrid_2019_03_01/test_storage_validators.py index 836d578ebc8..0bd49821da0 100644 --- a/src/azure-cli/azure/cli/command_modules/storage/tests/hybrid_2019_03_01/test_storage_validators.py +++ b/src/azure-cli/azure/cli/command_modules/storage/tests/hybrid_2019_03_01/test_storage_validators.py @@ -25,8 +25,8 @@ class MockCLI(CLI): def __init__(self): - super(MockCLI, self).__init__(cli_name='mock_cli', config_dir=GLOBAL_CONFIG_DIR, - config_env_var_prefix=ENV_VAR_PREFIX, commands_loader_cls=MockLoader) + super().__init__(cli_name='mock_cli', config_dir=GLOBAL_CONFIG_DIR, + config_env_var_prefix=ENV_VAR_PREFIX, commands_loader_cls=MockLoader) self.cloud = get_active_cloud(self) diff --git a/src/azure-cli/azure/cli/command_modules/storage/tests/hybrid_2020_09_01/test_storage_url_helpers.py b/src/azure-cli/azure/cli/command_modules/storage/tests/hybrid_2020_09_01/test_storage_url_helpers.py index 3b40205b4f6..e8da061abd2 100644 --- a/src/azure-cli/azure/cli/command_modules/storage/tests/hybrid_2020_09_01/test_storage_url_helpers.py +++ b/src/azure-cli/azure/cli/command_modules/storage/tests/hybrid_2020_09_01/test_storage_url_helpers.py @@ -14,8 +14,8 @@ class MockCLI(CLI): def __init__(self): - super(MockCLI, self).__init__(cli_name='mock_cli', config_dir=GLOBAL_CONFIG_DIR, - config_env_var_prefix=ENV_VAR_PREFIX) + super().__init__(cli_name='mock_cli', config_dir=GLOBAL_CONFIG_DIR, + config_env_var_prefix=ENV_VAR_PREFIX) self.cloud = get_active_cloud(self) diff --git a/src/azure-cli/azure/cli/command_modules/storage/tests/hybrid_2020_09_01/test_storage_validators.py b/src/azure-cli/azure/cli/command_modules/storage/tests/hybrid_2020_09_01/test_storage_validators.py index 836d578ebc8..0bd49821da0 100644 --- a/src/azure-cli/azure/cli/command_modules/storage/tests/hybrid_2020_09_01/test_storage_validators.py +++ b/src/azure-cli/azure/cli/command_modules/storage/tests/hybrid_2020_09_01/test_storage_validators.py @@ -25,8 +25,8 @@ class MockCLI(CLI): def __init__(self): - super(MockCLI, self).__init__(cli_name='mock_cli', config_dir=GLOBAL_CONFIG_DIR, - config_env_var_prefix=ENV_VAR_PREFIX, commands_loader_cls=MockLoader) + super().__init__(cli_name='mock_cli', config_dir=GLOBAL_CONFIG_DIR, + config_env_var_prefix=ENV_VAR_PREFIX, commands_loader_cls=MockLoader) self.cloud = get_active_cloud(self) diff --git a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_url_helpers.py b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_url_helpers.py index 3b40205b4f6..e8da061abd2 100644 --- a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_url_helpers.py +++ b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_url_helpers.py @@ -14,8 +14,8 @@ class MockCLI(CLI): def __init__(self): - super(MockCLI, self).__init__(cli_name='mock_cli', config_dir=GLOBAL_CONFIG_DIR, - config_env_var_prefix=ENV_VAR_PREFIX) + super().__init__(cli_name='mock_cli', config_dir=GLOBAL_CONFIG_DIR, + config_env_var_prefix=ENV_VAR_PREFIX) self.cloud = get_active_cloud(self) diff --git a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_validators.py b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_validators.py index c9276587271..a1f70eb5e6d 100644 --- a/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_validators.py +++ b/src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_validators.py @@ -26,8 +26,8 @@ class MockCLI(CLI): def __init__(self): - super(MockCLI, self).__init__(cli_name='mock_cli', config_dir=GLOBAL_CONFIG_DIR, - config_env_var_prefix=ENV_VAR_PREFIX, commands_loader_cls=MockLoader) + super().__init__(cli_name='mock_cli', config_dir=GLOBAL_CONFIG_DIR, + config_env_var_prefix=ENV_VAR_PREFIX, commands_loader_cls=MockLoader) self.cloud = get_active_cloud(self) self.data = {"headers": [], "completer_active": False, "command": ""} diff --git a/src/azure-cli/azure/cli/command_modules/storage/tests/storage_test_util.py b/src/azure-cli/azure/cli/command_modules/storage/tests/storage_test_util.py index 820d5aca6f3..865bc2abe95 100644 --- a/src/azure-cli/azure/cli/command_modules/storage/tests/storage_test_util.py +++ b/src/azure-cli/azure/cli/command_modules/storage/tests/storage_test_util.py @@ -80,7 +80,7 @@ def create_file_system(self, account_info, prefix='filesystem', length=24): class StorageTestFilesPreparer(AbstractPreparer): def __init__(self, parameter_name='test_dir'): - super(StorageTestFilesPreparer, self).__init__(name_prefix='test', name_len=24) + super().__init__(name_prefix='test', name_len=24) self.parameter_name = parameter_name def create_resource(self, name, **kwargs): diff --git a/src/azure-cli/azure/cli/command_modules/synapse/__init__.py b/src/azure-cli/azure/cli/command_modules/synapse/__init__.py index a696b0bc1c9..aedf0c58735 100644 --- a/src/azure-cli/azure/cli/command_modules/synapse/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/synapse/__init__.py @@ -21,8 +21,7 @@ def __init__(self, cli_ctx=None): synapse_custom = CliCommandType( operations_tmpl='azure.cli.command_modules.synapse.custom#{}', client_factory=cf_synapse_cl) - parent = super(SynapseManagementClientCommandsLoader, self) - parent.__init__(cli_ctx=cli_ctx, custom_command_type=synapse_custom) + super().__init__(cli_ctx=cli_ctx, custom_command_type=synapse_custom) def load_command_table(self, args): from .generated.commands import load_command_table diff --git a/src/azure-cli/azure/cli/command_modules/synapse/manual/action.py b/src/azure-cli/azure/cli/command_modules/synapse/manual/action.py index 309eae842f8..e35d04f3d27 100644 --- a/src/azure-cli/azure/cli/command_modules/synapse/manual/action.py +++ b/src/azure-cli/azure/cli/command_modules/synapse/manual/action.py @@ -12,7 +12,7 @@ class AddFilters(argparse._AppendAction): def __call__(self, parser, namespace, values, option_string=None): action = self.get_action(values, option_string) - super(AddFilters, self).__call__(parser, namespace, action, option_string) + super().__call__(parser, namespace, action, option_string) def get_action(self, values, option_string): # pylint: disable=no-self-use try: @@ -38,7 +38,7 @@ def get_action(self, values, option_string): # pylint: disable=no-self-use class AddOrderBy(argparse._AppendAction): def __call__(self, parser, namespace, values, option_string=None): action = self.get_action(values, option_string) - super(AddOrderBy, self).__call__(parser, namespace, action, option_string) + super().__call__(parser, namespace, action, option_string) def get_action(self, values, option_string): # pylint: disable=no-self-use try: @@ -137,7 +137,7 @@ def get_action(self, values, option_string): # pylint: disable=no-self-use class AddValue(argparse._AppendAction): def __call__(self, parser, namespace, values, option_string=None): action = self.get_action(values, option_string) - super(AddValue, self).__call__(parser, namespace, action, option_string) + super().__call__(parser, namespace, action, option_string) def get_action(self, values, option_string): # pylint: disable=no-self-use try: diff --git a/src/azure-cli/azure/cli/command_modules/util/__init__.py b/src/azure-cli/azure/cli/command_modules/util/__init__.py index cf0dce49a4a..b0b4e845dcc 100644 --- a/src/azure-cli/azure/cli/command_modules/util/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/util/__init__.py @@ -12,7 +12,7 @@ class UtilCommandsLoader(AzCommandsLoader): def __init__(self, cli_ctx=None): from azure.cli.core.commands import CliCommandType util_custom = CliCommandType(operations_tmpl='azure.cli.command_modules.util.custom#{}') - super(UtilCommandsLoader, self).__init__(cli_ctx=cli_ctx, custom_command_type=util_custom) + super().__init__(cli_ctx=cli_ctx, custom_command_type=util_custom) def load_command_table(self, args): from azure.cli.command_modules.util.commands import load_command_table diff --git a/src/azure-cli/azure/cli/command_modules/vm/__init__.py b/src/azure-cli/azure/cli/command_modules/vm/__init__.py index 4097503d544..69b0b8d664a 100644 --- a/src/azure-cli/azure/cli/command_modules/vm/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/vm/__init__.py @@ -24,10 +24,10 @@ def __init__(self, cli_ctx=None): operations_tmpl='azure.cli.command_modules.vm.custom#{}', operation_group='virtual_machines' ) - super(ComputeCommandsLoader, self).__init__(cli_ctx=cli_ctx, - resource_type=ResourceType.MGMT_COMPUTE, - operation_group='virtual_machines', - custom_command_type=compute_custom) + super().__init__(cli_ctx=cli_ctx, + resource_type=ResourceType.MGMT_COMPUTE, + operation_group='virtual_machines', + custom_command_type=compute_custom) def load_command_table(self, args): from azure.cli.command_modules.vm.commands import load_command_table diff --git a/src/azure-cli/azure/cli/command_modules/vm/tests/hybrid_2018_03_01/test_vm_defaults.py b/src/azure-cli/azure/cli/command_modules/vm/tests/hybrid_2018_03_01/test_vm_defaults.py index bc3baff0c0a..88a4935b06e 100644 --- a/src/azure-cli/azure/cli/command_modules/vm/tests/hybrid_2018_03_01/test_vm_defaults.py +++ b/src/azure-cli/azure/cli/command_modules/vm/tests/hybrid_2018_03_01/test_vm_defaults.py @@ -244,7 +244,7 @@ def test_new_subnet_size_for_small_vmss(self): class TestVMCreateDefaultStorageAccount(unittest.TestCase): def __init__(self, methodName): - super(TestVMCreateDefaultStorageAccount, self).__init__(methodName) + super().__init__(methodName) self.ns = None def _set_ns(self, rg, location=None, tier='Standard'): diff --git a/src/azure-cli/azure/cli/command_modules/vm/tests/hybrid_2019_03_01/test_vm_defaults.py b/src/azure-cli/azure/cli/command_modules/vm/tests/hybrid_2019_03_01/test_vm_defaults.py index f0b0da1dcd8..dcfcb3d639d 100644 --- a/src/azure-cli/azure/cli/command_modules/vm/tests/hybrid_2019_03_01/test_vm_defaults.py +++ b/src/azure-cli/azure/cli/command_modules/vm/tests/hybrid_2019_03_01/test_vm_defaults.py @@ -247,7 +247,7 @@ def test_new_subnet_size_for_small_vmss(self): class TestVMCreateDefaultStorageAccount(unittest.TestCase): def __init__(self, methodName): - super(TestVMCreateDefaultStorageAccount, self).__init__(methodName) + super().__init__(methodName) self.ns = None def _set_ns(self, rg, location=None, tier='Standard'): diff --git a/src/azure-cli/azure/cli/command_modules/vm/tests/hybrid_2020_09_01/test_vm_defaults.py b/src/azure-cli/azure/cli/command_modules/vm/tests/hybrid_2020_09_01/test_vm_defaults.py index 940e08cfc19..d8e0bc301bd 100644 --- a/src/azure-cli/azure/cli/command_modules/vm/tests/hybrid_2020_09_01/test_vm_defaults.py +++ b/src/azure-cli/azure/cli/command_modules/vm/tests/hybrid_2020_09_01/test_vm_defaults.py @@ -265,7 +265,7 @@ def test_new_subnet_size_for_small_vmss(self): class TestVMCreateDefaultStorageAccount(unittest.TestCase): def __init__(self, methodName): - super(TestVMCreateDefaultStorageAccount, self).__init__(methodName) + super().__init__(methodName) self.ns = None def _set_ns(self, rg, location=None, tier='Standard'): diff --git a/src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py b/src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py index a4f3ab4489f..77013415af9 100644 --- a/src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py +++ b/src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py @@ -2630,7 +2630,7 @@ def __init__(self, method_name, config_file=None, recording_dir=None, recording_ replay_processors=None, recording_patches=None, replay_patches=None): from azure.cli.command_modules.vm.tests.latest._test_util import TimeSpanProcessor TIMESPANTEMPLATE = '0000-00-00' - super(VMMonitorTestDefault, self).__init__( + super().__init__( method_name, recording_processors=[TimeSpanProcessor(TIMESPANTEMPLATE)], replay_processors=[TimeSpanProcessor(TIMESPANTEMPLATE)] diff --git a/src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_defaults.py b/src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_defaults.py index a03a6e18628..03480c8160b 100644 --- a/src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_defaults.py +++ b/src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_defaults.py @@ -244,7 +244,7 @@ def test_new_subnet_size_for_small_vmss(self): class TestVMCreateDefaultStorageAccount(unittest.TestCase): def __init__(self, methodName): - super(TestVMCreateDefaultStorageAccount, self).__init__(methodName) + super().__init__(methodName) self.ns = None def _set_ns(self, rg, location=None, tier='Standard'): diff --git a/src/azure-cli/azure_cli_bdist_wheel.py b/src/azure-cli/azure_cli_bdist_wheel.py index 6decd64813a..51db8cc5491 100644 --- a/src/azure-cli/azure_cli_bdist_wheel.py +++ b/src/azure-cli/azure_cli_bdist_wheel.py @@ -10,11 +10,11 @@ class azure_cli_build_py(build_py): def initialize_options(self): - super(azure_cli_build_py, self).initialize_options() + super().initialize_options() self.extra_build_source_files = None def build_packages(self): - super(azure_cli_build_py, self).build_packages() + super().build_packages() if self.extra_build_source_files: package, module, module_file = self.extra_build_source_files.split(',') self.build_module(module, module_file, package) diff --git a/tools/automation/verify/verify_commands.py b/tools/automation/verify/verify_commands.py index 265329fdfc5..459a80da60d 100644 --- a/tools/automation/verify/verify_commands.py +++ b/tools/automation/verify/verify_commands.py @@ -29,7 +29,7 @@ def run_commands(args): class MockCLI(CLI): def __init__(self): - super(MockCLI, self).__init__( + super().__init__( cli_name='mock_cli', config_dir=GLOBAL_CONFIG_DIR, config_env_var_prefix=ENV_VAR_PREFIX) diff --git a/tools/automation/verify/verify_packages.py b/tools/automation/verify/verify_packages.py index 04763e4a19c..edf81eebb61 100644 --- a/tools/automation/verify/verify_packages.py +++ b/tools/automation/verify/verify_packages.py @@ -24,7 +24,7 @@ # It also ensures all the items were ran and errors are collected. class PackageVerifyTests(unittest.TestCase): def __init__(self, method_name, **kwargs): - super(PackageVerifyTests, self).__init__(method_name) + super().__init__(method_name) self.test_data = kwargs def test_azure_cli_module_manifest_and_azure_bdist(self):