diff --git a/zaza/openstack/charm_tests/ceilometer/tests.py b/zaza/openstack/charm_tests/ceilometer/tests.py index c93dcf756..6532b353d 100644 --- a/zaza/openstack/charm_tests/ceilometer/tests.py +++ b/zaza/openstack/charm_tests/ceilometer/tests.py @@ -126,7 +126,7 @@ def test_900_restart_on_config_change(self): current_value = openstack_utils.get_application_config_option( self.application_name, config_name ) - assert type(current_value) == bool + self.assertIsInstance(current_value, bool) new_value = not current_value # Convert bool to str diff --git a/zaza/openstack/utilities/openstack.py b/zaza/openstack/utilities/openstack.py index e8a2ca903..499eab4d3 100644 --- a/zaza/openstack/utilities/openstack.py +++ b/zaza/openstack/utilities/openstack.py @@ -2241,6 +2241,12 @@ def find_ubuntu_image(release, arch): return UBUNTU_IMAGE_URLS[release].format(release=release, arch=arch) +@tenacity.retry( + wait=tenacity.wait_fixed(2), + stop=tenacity.stop_after_attempt(10), + reraise=True, + retry=tenacity.retry_if_exception_type(urllib.error.ContentTooShortError), +) def download_image(image_url, target_file): """Download the image from the given url to the specified file.