diff options
author | Paride Legovini <paride.legovini@canonical.com> | 2020-08-25 17:21:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-25 09:21:18 -0600 |
commit | 07104504ab5b30efd2d1f7a8c36effe18b8e5fe0 (patch) | |
tree | c441dddd012f81dad39cfe97821d83bc7ee1a82b /tests/cloud_tests/platforms/ec2/platform.py | |
parent | 4068137e3ef048d3e2da56a8190f682eb19d501e (diff) | |
download | vyos-cloud-init-07104504ab5b30efd2d1f7a8c36effe18b8e5fe0.tar.gz vyos-cloud-init-07104504ab5b30efd2d1f7a8c36effe18b8e5fe0.zip |
tox: bump the pylint version to 2.6.0 in the default run (#544)
Changes:
tox: bump the pylint version to 2.6.0 in the default run
Fix pylint 2.6.0 W0707 warnings (raise-missing-from)
Diffstat (limited to 'tests/cloud_tests/platforms/ec2/platform.py')
-rw-r--r-- | tests/cloud_tests/platforms/ec2/platform.py | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/tests/cloud_tests/platforms/ec2/platform.py b/tests/cloud_tests/platforms/ec2/platform.py index 7a3d0fe0..b61a2ffb 100644 --- a/tests/cloud_tests/platforms/ec2/platform.py +++ b/tests/cloud_tests/platforms/ec2/platform.py @@ -35,12 +35,14 @@ class EC2Platform(Platform): self.ec2_resource = b3session.resource('ec2') self.ec2_region = b3session.region_name self.key_name = self._upload_public_key(config) - except botocore.exceptions.NoRegionError: + except botocore.exceptions.NoRegionError as e: raise RuntimeError( - 'Please configure default region in $HOME/.aws/config') - except botocore.exceptions.NoCredentialsError: + 'Please configure default region in $HOME/.aws/config' + ) from e + except botocore.exceptions.NoCredentialsError as e: raise RuntimeError( - 'Please configure ec2 credentials in $HOME/.aws/credentials') + 'Please configure ec2 credentials in $HOME/.aws/credentials' + ) from e self.vpc = self._create_vpc() self.internet_gateway = self._create_internet_gateway() @@ -125,8 +127,10 @@ class EC2Platform(Platform): try: image_ami = image['id'] - except KeyError: - raise RuntimeError('No images found for %s!' % img_conf['release']) + except KeyError as e: + raise RuntimeError( + 'No images found for %s!' % img_conf['release'] + ) from e LOG.debug('found image: %s', image_ami) image = EC2Image(self, img_conf, image_ami) @@ -195,7 +199,7 @@ class EC2Platform(Platform): CidrBlock=self.ipv4_cidr, AmazonProvidedIpv6CidrBlock=True) except botocore.exceptions.ClientError as e: - raise RuntimeError(e) + raise RuntimeError(e) from e vpc.wait_until_available() self._tag_resource(vpc) |