From d3097af0ab004f068e5245d837b356d97588bf95 Mon Sep 17 00:00:00 2001 From: Ricardo Branco Date: Thu, 31 Aug 2023 08:39:41 +0200 Subject: [PATCH 1/2] Fix no-else-continue / no-else-return --- ocw/lib/ec2.py | 3 +-- ocw/lib/gce.py | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/ocw/lib/ec2.py b/ocw/lib/ec2.py index a942d0d6..6cca140c 100644 --- a/ocw/lib/ec2.py +++ b/ocw/lib/ec2.py @@ -181,8 +181,7 @@ def delete_vpc_subnets(self, vpc) -> None: if exc.response['Error']['Code'] == 'InvalidParameterValue': self.log_info(exc.response['Error']) continue - else: - raise + raise if self.dry_run: self.log_info(f'Deletion of {subnet} skipped due to dry_run mode') else: diff --git a/ocw/lib/gce.py b/ocw/lib/gce.py index af8a7673..ab4348e4 100644 --- a/ocw/lib/gce.py +++ b/ocw/lib/gce.py @@ -103,8 +103,7 @@ def list_zones(self, region) -> list: if GCE.get_error_reason(exc) == 'notFound': self.log_dbg("list_zones: region {} not found", region) return [] - else: - raise exc + raise exc def delete_instance(self, instance_id, zone) -> None: self._delete_resource( From 01e991d3c8fe6b989213d9751397f7eb8cae2850 Mon Sep 17 00:00:00 2001 From: Ricardo Branco Date: Thu, 31 Aug 2023 08:41:19 +0200 Subject: [PATCH 2/2] Disable insecure=True in Openstack --- ocw/lib/openstack.py | 1 - 1 file changed, 1 deletion(-) diff --git a/ocw/lib/openstack.py b/ocw/lib/openstack.py index 2915b484..0612b52a 100644 --- a/ocw/lib/openstack.py +++ b/ocw/lib/openstack.py @@ -25,7 +25,6 @@ def client(self) -> None: if self.__client is None: self.__client = openstack.connect( debug=bool(DEBUG), - insecure=True, # Trust the certificate auth_url=self.get_data('auth_url'), project_name=self.get_data('project_name'), username=self.get_data('username'),