From 8adbceaf260b65b75d2e2ff63d64629223c91a14 Mon Sep 17 00:00:00 2001 From: Felipe Reyes Date: Fri, 5 May 2023 11:41:22 +0200 Subject: [PATCH 1/2] Retry when listing glance images. Issue seen at the gate: glanceclient.exc.CommunicationError: [...] ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')) --- zaza/openstack/utilities/openstack.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/zaza/openstack/utilities/openstack.py b/zaza/openstack/utilities/openstack.py index 9f710e1..710e0d3 100644 --- a/zaza/openstack/utilities/openstack.py +++ b/zaza/openstack/utilities/openstack.py @@ -53,6 +53,7 @@ from cinderclient import client as cinderclient from heatclient import client as heatclient from magnumclient import client as magnumclient from glanceclient import Client as GlanceClient +from glanceclient.exc import CommunicationError from designateclient.client import Client as DesignateClient from keystoneclient.v2_0 import client as keystoneclient_v2 @@ -2333,6 +2334,9 @@ def get_urllib_opener(): return urllib.request.build_opener(handler) +@tenacity.retry(wait=tenacity.wait_exponential(multiplier=1, max=60), + reraise=True, + retry=tenacity.retry_if_exception_type(CommunicationError)) def get_images_by_name(glance, image_name): """Get all glance image objects with the given name. From fd65705445325e84774be96bdd265d5dd5f0fadb Mon Sep 17 00:00:00 2001 From: Felipe Reyes Date: Fri, 5 May 2023 11:51:20 +0200 Subject: [PATCH 2/2] Bump up flake8 Fixes `AttributeError: 'FlakesChecker' object has no attribute 'CONSTANT'` --- requirements.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index 8529212..533a702 100644 --- a/requirements.txt +++ b/requirements.txt @@ -14,11 +14,11 @@ pyopenssl<22.1.0 boto3<1.25 PyYAML<=4.2,>=3.0; python_version < '3.9' PyYAML>=5.1; python_version >= '3.9' -flake8>=2.2.4 +flake8>=5 # Python 3.8 compatibility in pyflakes 2.1.0+ flake8-docstrings flake8-per-file-ignores pydocstyle<4.0.0 -coverage<6.0.0 # coverage 6.0+ drops support for py3.5/py2.7 +coverage<6.0.0; python_version <= '3.5' # coverage 6.0+ drops support for py3.5/py2.7 mock>=1.2 pytest pytest-cov