本文整理汇总了Python中tempest.common.cred_provider.get_configured_credentials函数的典型用法代码示例。如果您正苦于以下问题:Python get_configured_credentials函数的具体用法?Python get_configured_credentials怎么用?Python get_configured_credentials使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_configured_credentials函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _verify_credentials
def _verify_credentials(self, credentials_class, filled=True,
identity_version=None):
for ctype in cred_provider.CREDENTIAL_TYPES:
if identity_version is None:
creds = cred_provider.get_configured_credentials(
credential_type=ctype, fill_in=filled)
else:
creds = cred_provider.get_configured_credentials(
credential_type=ctype, fill_in=filled,
identity_version=identity_version)
self._check(creds, credentials_class, filled)
示例2: is_admin_available
def is_admin_available():
is_admin = True
# In the case of a pre-provisioned account, if even if creds were
# configured, the admin credentials won't be available
if (CONF.auth.locking_credentials_provider and
not CONF.auth.allow_tenant_isolation):
is_admin = False
else:
try:
cred_provider.get_configured_credentials('identity_admin')
except NotImplementedError:
is_admin = False
return is_admin
示例3: __init__
def __init__(self, credentials=None):
"""
We allow overriding of the credentials used within the various
client classes managed by the Manager object. Left as None, the
standard username/password/tenant_name[/domain_name] is used.
:param credentials: Override of the credentials
"""
self.auth_version = CONF.identity.auth_version
if credentials is None:
self.credentials = cred_provider.get_configured_credentials('user')
else:
self.credentials = credentials
# Check if passed or default credentials are valid
if not self.credentials.is_valid():
raise exceptions.InvalidCredentials()
# Tenant isolation creates TestResources, but Accounts and some tests
# creates Credentials
if isinstance(credentials, cred_provider.TestResources):
creds = self.credentials.credentials
else:
creds = self.credentials
# Creates an auth provider for the credentials
self.auth_provider = get_auth_provider(creds)
# FIXME(andreaf) unused
self.client_attr_names = []
示例4: create_client
def create_client(self, client_type):
creds = cred_provider.get_configured_credentials('identity_admin')
auth_prov = tempestmanager.get_auth_provider(creds)
return policy_client.PolicyClient(
auth_prov, client_type,
CONF.identity.region)
示例5: __init__
def __init__(self):
os = clients.Manager(
cred_provider.get_configured_credentials('user', fill_in=False))
self.images_client = os.images_client
self.flavors_client = os.flavors_client
self.image_pattern = CONF.input_scenario.image_regex
self.flavor_pattern = CONF.input_scenario.flavor_regex
示例6: setUpClass
def setUpClass(cls):
super(ScenarioPolicyBase, cls).setUpClass()
# auth provider for admin credentials
creds = cred_provider.get_configured_credentials("identity_admin")
auth_prov = tempestmanager.get_auth_provider(creds)
cls.admin_manager.congress_client = policy_client.PolicyClient(auth_prov, "policy", CONF.identity.region)
示例7: get_primary_creds
def get_primary_creds(self):
if self.isolated_creds.get('primary'):
return self.isolated_creds.get('primary')
primary_credential = cred_provider.get_configured_credentials(
credential_type='user', identity_version=self.identity_version)
self.isolated_creds['primary'] = cred_provider.TestResources(
primary_credential)
return self.isolated_creds['primary']
示例8: get_alt_creds
def get_alt_creds(self):
if self._creds.get("alt"):
return self._creds.get("alt")
alt_credential = cred_provider.get_configured_credentials(
credential_type="alt_user", identity_version=self.identity_version
)
self._creds["alt"] = cred_provider.TestResources(alt_credential)
return self._creds["alt"]
示例9: get_primary_creds
def get_primary_creds(self):
if self._creds.get("primary"):
return self._creds.get("primary")
primary_credential = cred_provider.get_configured_credentials(
credential_type="user", identity_version=self.identity_version
)
self._creds["primary"] = cred_provider.TestResources(primary_credential)
return self._creds["primary"]
示例10: get_alt_creds
def get_alt_creds(self):
if self.isolated_creds.get('alt'):
return self.isolated_creds.get('alt')
alt_credential = cred_provider.get_configured_credentials(
credential_type='alt_user',
identity_version=self.identity_version)
self.isolated_creds['alt'] = cred_provider.TestResources(
alt_credential)
return self.isolated_creds['alt']
示例11: is_admin_available
def is_admin_available():
is_admin = True
# If dynamic credentials is enabled admin will be available
if CONF.auth.use_dynamic_credentials:
return is_admin
# Check whether test accounts file has the admin specified or not
elif (CONF.auth.test_accounts_file and
os.path.isfile(CONF.auth.test_accounts_file)):
check_accounts = accounts.Accounts(name='check_admin')
if not check_accounts.admin_available():
is_admin = False
else:
try:
cred_provider.get_configured_credentials('identity_admin',
fill_in=False)
except exceptions.InvalidConfiguration:
is_admin = False
return is_admin
示例12: setUpClass
def setUpClass(cls):
super(TestCase, cls).setUpClass()
# If no credentials are provided, the Manager will use those
# in CONF.identity and generate an auth_provider from them
cls.creds = cred_provider.get_configured_credentials(
credential_type='identity_admin')
mgr = clients.Manager(cls.creds)
cls.client = MuranoClient(mgr.auth_provider)
示例13: get_alt_creds
def get_alt_creds(self):
if self.isolated_creds.get('alt'):
return self.isolated_creds.get('alt')
if not self.use_default_creds:
creds = self.get_creds(1)
alt_credential = cred_provider.get_credentials(**creds)
else:
alt_credential = cred_provider.get_configured_credentials(
'alt_user')
self.isolated_creds['alt'] = alt_credential
return alt_credential
示例14: get_primary_creds
def get_primary_creds(self):
if self.isolated_creds.get('primary'):
return self.isolated_creds.get('primary')
if not self.use_default_creds:
creds = self.get_creds(0)
primary_credential = cred_provider.get_credentials(**creds)
else:
primary_credential = cred_provider.get_configured_credentials(
'user')
self.isolated_creds['primary'] = primary_credential
return primary_credential
示例15: is_admin_available
def is_admin_available(identity_version):
is_admin = True
# If dynamic credentials is enabled admin will be available
if CONF.auth.use_dynamic_credentials:
return is_admin
# Check whether test accounts file has the admin specified or not
elif (CONF.auth.test_accounts_file and
os.path.isfile(CONF.auth.test_accounts_file)):
check_accounts = preprov_creds.PreProvisionedCredentialProvider(
identity_version=identity_version, name='check_admin',
admin_role=CONF.identity.admin_role)
if not check_accounts.admin_available():
is_admin = False
else:
try:
cred_provider.get_configured_credentials(
'identity_admin', fill_in=False,
identity_version=identity_version)
except exceptions.InvalidConfiguration:
is_admin = False
return is_admin