From 068d162127cbb4f898e4ec9658df8af50dcf6bc4 Mon Sep 17 00:00:00 2001 From: Kenneth Daily Date: Mon, 23 Dec 2024 12:32:23 -0800 Subject: [PATCH] Run ruff check --fix --unsafe-fixes --- awscli/customizations/ec2/bundleinstance.py | 2 +- awscli/customizations/ec2/decryptpassword.py | 3 +-- awscli/customizations/ec2/secgroupsimplify.py | 4 ++-- awscli/customizations/ec2instanceconnect/ssh.py | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/awscli/customizations/ec2/bundleinstance.py b/awscli/customizations/ec2/bundleinstance.py index cc6802d6f47c..160e832d626e 100644 --- a/awscli/customizations/ec2/bundleinstance.py +++ b/awscli/customizations/ec2/bundleinstance.py @@ -165,7 +165,7 @@ def register_bundleinstance(event_handler): class BundleArgument(CustomArgument): def __init__(self, storage_param, *args, **kwargs): - super(BundleArgument, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) self._storage_param = storage_param def _build_storage(self, params, value): diff --git a/awscli/customizations/ec2/decryptpassword.py b/awscli/customizations/ec2/decryptpassword.py index b948c7051f2d..9bf6de16dd56 100644 --- a/awscli/customizations/ec2/decryptpassword.py +++ b/awscli/customizations/ec2/decryptpassword.py @@ -81,8 +81,7 @@ def add_to_params(self, parameters, value): if os.path.isfile(path): self._key_path = path service_id = self._operation_model.service_model.service_id - event = 'after-call.%s.%s' % (service_id.hyphenize(), - self._operation_model.name) + event = f'after-call.{service_id.hyphenize()}.{self._operation_model.name}' self._session.register(event, self._decrypt_password_data) else: msg = ('priv-launch-key should be a path to the ' diff --git a/awscli/customizations/ec2/secgroupsimplify.py b/awscli/customizations/ec2/secgroupsimplify.py index 1debca5c76ec..919e8afaa439 100644 --- a/awscli/customizations/ec2/secgroupsimplify.py +++ b/awscli/customizations/ec2/secgroupsimplify.py @@ -63,8 +63,8 @@ def _check_args(parsed_args, **kwargs): for key in ('protocol', 'port', 'cidr', 'source_group', 'group_owner'): if arg_dict[key]: - msg = ('The --%s option is not compatible ' - 'with the --ip-permissions option ') % key + msg = (f'The --{key} option is not compatible ' + 'with the --ip-permissions option ') raise ParamValidationError(msg) diff --git a/awscli/customizations/ec2instanceconnect/ssh.py b/awscli/customizations/ec2instanceconnect/ssh.py index 3ba2f975255f..e9988be5817f 100644 --- a/awscli/customizations/ec2instanceconnect/ssh.py +++ b/awscli/customizations/ec2instanceconnect/ssh.py @@ -138,7 +138,7 @@ class SshCommand(BasicCommand): DESCRIPTION = 'Connect to your EC2 instance using your OpenSSH client.' def __init__(self, session, key_manager=None): - super(SshCommand, self).__init__(session) + super().__init__(session) self._key_manager = KeyManager() if (key_manager is None) else key_manager def _run_main(self, parsed_args, parsed_globals):