当前位置: 首页>>代码示例>>Python>>正文


Python cred_provider.get_configured_credentials函数代码示例

本文整理汇总了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)
开发者ID:midokura,项目名称:tempest,代码行数:11,代码来源:test_cred_provider.py

示例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
开发者ID:midokura,项目名称:tempest,代码行数:14,代码来源:credentials.py

示例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 = []
开发者ID:NeetaP,项目名称:tempest,代码行数:26,代码来源:manager.py

示例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)
开发者ID:ekcs,项目名称:congress,代码行数:7,代码来源:test_ha.py

示例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
开发者ID:Dynavisor,项目名称:tempest,代码行数:7,代码来源:utils.py

示例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)
开发者ID:stevei101,项目名称:congress,代码行数:7,代码来源:manager_congress.py

示例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']
开发者ID:kinderyj,项目名称:tempest,代码行数:8,代码来源:accounts.py

示例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"]
开发者ID:subecho,项目名称:tempest,代码行数:8,代码来源:accounts.py

示例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"]
开发者ID:subecho,项目名称:tempest,代码行数:8,代码来源:accounts.py

示例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']
开发者ID:kinderyj,项目名称:tempest,代码行数:9,代码来源:accounts.py

示例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
开发者ID:subecho,项目名称:tempest,代码行数:18,代码来源:credentials.py

示例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)
开发者ID:tianshangjun,项目名称:murano,代码行数:9,代码来源:base.py

示例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
开发者ID:midokura,项目名称:tempest,代码行数:11,代码来源:accounts.py

示例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
开发者ID:midokura,项目名称:tempest,代码行数:11,代码来源:accounts.py

示例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
开发者ID:ravisantoshgudimetla,项目名称:tempest,代码行数:21,代码来源:credentials.py


注:本文中的tempest.common.cred_provider.get_configured_credentials函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。