Add check on role availability before request creds by roles
This commit adds a new method to the cred_provider abstract class,
is_role_available(), which will return true if the provider can provide
creds with the request roles, or false if it can't. This method is then
used before any calls to get_creds_by_roles() to definitively check
whether the test is expected to be able to be executed.
Closes-Bug: #1429322
Change-Id: I00f61007b2b0605c07ac77773151562c5cf6ce85
diff --git a/tempest/common/cred_provider.py b/tempest/common/cred_provider.py
index c22dc1f..ea628f6 100644
--- a/tempest/common/cred_provider.py
+++ b/tempest/common/cred_provider.py
@@ -117,3 +117,7 @@
@abc.abstractmethod
def get_creds_by_roles(self, roles, force_new=False):
return
+
+ @abc.abstractmethod
+ def is_role_available(self, role):
+ return