From f42d17deb2000e529f4972fec65483ae68b34f31 Mon Sep 17 00:00:00 2001 From: Alexey Vazhnov Date: Sat, 16 Feb 2019 01:02:18 +0300 Subject: [PATCH 1/2] Fixed: missing whitespace around arithmetic operator [E226] --- awsudo/rotate.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/awsudo/rotate.py b/awsudo/rotate.py index 5e8bb2f..ec9977c 100644 --- a/awsudo/rotate.py +++ b/awsudo/rotate.py @@ -50,7 +50,7 @@ def updateCredentials(self, keyId, secretKey): self._config.set(self.section, 'aws_secret_access_key', secretKey) os.umask(0o0066) - os.rename(self._filename, self._filename+'~') + os.rename(self._filename, self._filename + '~') with open(self._filename, 'w') as f: self._config.write(f) @@ -130,9 +130,9 @@ def getUserName(iam): @retry( - stop_max_delay=60*1000, + stop_max_delay=60 * 1000, wait_exponential_multiplier=250, - wait_exponential_max=10*1000, + wait_exponential_max=10 * 1000, retry_on_exception=lambda e: isinstance(e, BotoServerError)) def deactivateKey(iam, oldKey, userName): """Set the given key as inactive. From 7e8b8c60004a9d2a04c4aa3a2aecdd65d12eb0fa Mon Sep 17 00:00:00 2001 From: Alexey Vazhnov Date: Sat, 16 Feb 2019 01:13:41 +0300 Subject: [PATCH 2/2] =?UTF-8?q?http=20=E2=86=92=20https?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 14 +++++++------- awsudo/config.py | 4 ++-- awsudo/rotate.py | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index c46c7d4..a729afc 100644 --- a/README.md +++ b/README.md @@ -114,10 +114,10 @@ pyenv rehash tox ``` - [credentials]: http://blogs.aws.amazon.com/security/post/Tx3D6U6WSFGOK2H/A-New-and-Standardized-Way-to-Manage-Credentials-in-the-AWS-SDKs - [best practices]: http://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html - [assume a role]: http://docs.aws.amazon.com/cli/latest/userguide/cli-roles.html - [temporary credentials]: http://docs.aws.amazon.com/STS/latest/UsingSTS/Welcome.html - [account number]: http://docs.aws.amazon.com/general/latest/gr/acct-identifiers.html - [requires MFA]: http://docs.aws.amazon.com/cli/latest/userguide/cli-roles.html#cli-roles-mfa - [AWS CLI guide]: http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html + [credentials]: https://blogs.aws.amazon.com/security/post/Tx3D6U6WSFGOK2H/A-New-and-Standardized-Way-to-Manage-Credentials-in-the-AWS-SDKs + [best practices]: https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html + [assume a role]: https://docs.aws.amazon.com/cli/latest/userguide/cli-roles.html + [temporary credentials]: https://docs.aws.amazon.com/STS/latest/UsingSTS/Welcome.html + [account number]: https://docs.aws.amazon.com/general/latest/gr/acct-identifiers.html + [requires MFA]: https://docs.aws.amazon.com/cli/latest/userguide/cli-roles.html#cli-roles-mfa + [AWS CLI guide]: https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html diff --git a/awsudo/config.py b/awsudo/config.py index b042320..49175ea 100644 --- a/awsudo/config.py +++ b/awsudo/config.py @@ -29,8 +29,8 @@ def set(key, value): set('AWS_SECRET_ACCESS_KEY', creds.secret_key) # AWS_SESSION_TOKEN is the ostensibly the standard: - # http://blogs.aws.amazon.com/security/post/Tx3D6U6WSFGOK2H/A-New-and-Standardized-Way-to-Manage-Credentials-in-the-AWS-SDKs - # http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html#cli-environment + # https://blogs.aws.amazon.com/security/post/Tx3D6U6WSFGOK2H/A-New-and-Standardized-Way-to-Manage-Credentials-in-the-AWS-SDKs + # https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html#cli-environment set('AWS_SESSION_TOKEN', creds.token) # ...but boto expects AWS_SECURITY_TOKEN. Set both for compatibility. diff --git a/awsudo/rotate.py b/awsudo/rotate.py index ec9977c..b580d61 100644 --- a/awsudo/rotate.py +++ b/awsudo/rotate.py @@ -8,7 +8,7 @@ from boto.iam.connection import IAMConnection from boto.exception import BotoServerError -ACCESS_KEY_DOCS = 'http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html' +ACCESS_KEY_DOCS = 'https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html' try: from configparser import RawConfigParser