Skip integration tests when Swift is not available
Let's skip integration tests using Swift when the service is not
available. It will help turn the py3 gate green.
Change-Id: Ib3536583dbb3bbf50d9c64976e909fd352391d05
diff --git a/common/test.py b/common/test.py
index b422012..e387f3e 100644
--- a/common/test.py
+++ b/common/test.py
@@ -18,6 +18,7 @@
import fixtures
from heatclient import exc as heat_exceptions
+from keystoneauth1 import exceptions as kc_exceptions
from neutronclient.common import exceptions as network_exceptions
from oslo_log import log as logging
from oslo_utils import timeutils
@@ -194,6 +195,15 @@
return False
return True
+ def is_service_available(self, service_type):
+ try:
+ self.identity_client.get_endpoint_url(
+ service_type, self.conf.region)
+ except kc_exceptions.EndpointNotFound:
+ return False
+ else:
+ return True
+
@staticmethod
def _stack_output(stack, output_key, validate_errors=True):
"""Return a stack output value for a given key."""