• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python cred_provider.get_configured_credentials函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中tempest.common.cred_provider.get_configured_credentials函数的典型用法代码示例。如果您正苦于以下问题:Python get_configured_credentials函数的具体用法?Python get_configured_credentials怎么用?Python get_configured_credentials使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_configured_credentials函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: __init__

 def __init__(self, identity_version=None, name=None,
              network_resources=None):
     super(IsolatedCreds, self).__init__(identity_version, name,
                                         network_resources)
     self.network_resources = network_resources
     self.isolated_creds = {}
     self.ports = []
     self.default_admin_creds = cred_provider.get_configured_credentials(
         'identity_admin', fill_in=True,
         identity_version=self.identity_version)
     self.identity_admin_client, self.network_admin_client = (
         self._get_admin_clients())
     # Domain where isolated credentials are provisioned (v3 only).
     # Use that of the admin account is None is configured.
     self.creds_domain_name = None
     if self.identity_version == 'v3':
         self.creds_domain_name = (
             CONF.auth.tenant_isolation_domain_name or
             self.default_admin_creds.project_domain_name)
     self.creds_client = get_creds_client(
         self.identity_admin_client, self.creds_domain_name)
开发者ID:hisoumit,项目名称:tempest,代码行数:21,代码来源:isolated_creds.py


示例17: __init__

 def __init__(self, identity_version, name=None, network_resources=None,
              credentials_domain=None):
     super(DynamicCredentialProvider, self).__init__(
         identity_version=identity_version, name=name,
         network_resources=network_resources,
         credentials_domain=credentials_domain)
     self._creds = {}
     self.ports = []
     self.default_admin_creds = cred_provider.get_configured_credentials(
         'identity_admin', fill_in=True,
         identity_version=self.identity_version)
     (self.identity_admin_client, self.network_admin_client,
      self.networks_admin_client,
      self.subnets_admin_client) = self._get_admin_clients()
     # Domain where isolated credentials are provisioned (v3 only).
     # Use that of the admin account is None is configured.
     self.creds_domain_name = None
     if self.identity_version == 'v3':
         self.creds_domain_name = (
             self.default_admin_creds.project_domain_name or
             self.credentials_domain)
     self.creds_client = cred_client.get_creds_client(
         self.identity_admin_client, self.creds_domain_name)
开发者ID:Kiran-r,项目名称:Maple-tempest,代码行数:23,代码来源:dynamic_creds.py


示例18: main

def main():
    credentials = cred_provider.get_configured_credentials('identity_admin')
    network_client, image_client, glance_client, nova_client = set_context(credentials)
    # Start to config
    fix_cirros(glance_client, image_client)
    fix_tempest_conf(network_client, nova_client)
开发者ID:midokura,项目名称:tempest,代码行数:6,代码来源:mido-setup.py


示例19: main

def main():
    config = read_tempest_conf()
    credentials = cred_provider.get_configured_credentials('identity_admin')
    manager = clients.Manager(credentials=credentials)
    check_image_ref(manager)
    fix_tempest_conf(manager, config)
开发者ID:lezbar,项目名称:tempest-add,代码行数:6,代码来源:mido-setup.py


示例20: __init__

 def __init__(self, service=None):
     super(AdminManager, self).__init__(
         credentials=cred_provider.get_configured_credentials(
             'identity_admin'),
         service=service)
开发者ID:koshi-m,项目名称:tempest,代码行数:5,代码来源:clients.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python fixed_network.set_networks_kwarg函数代码示例发布时间:2022-05-27
下一篇:
Python compute.create_test_server函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap