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


Python clients.Manager方法代码示例

本文整理汇总了Python中tempest.clients.Manager方法的典型用法代码示例。如果您正苦于以下问题:Python clients.Manager方法的具体用法?Python clients.Manager怎么用?Python clients.Manager使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在tempest.clients的用法示例。


在下文中一共展示了clients.Manager方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from tempest import clients [as 别名]
# 或者: from tempest.clients import Manager [as 别名]
def __init__(self,
                 credentials=None):
        """Initialization of Manager class.

        Setup service client and make it available for test cases.
        :param credentials: type Credentials or TestResources
        """
        if credentials is None:
            global ADMIN_CREDS
            if ADMIN_CREDS is None:
                ADMIN_CREDS = common_creds.get_configured_admin_credentials()
            credentials = ADMIN_CREDS
        super(Manager, self).__init__(credentials)
        default_params_with_timeout_values = {
            'build_interval': CONF.compute.build_interval,
            'build_timeout': CONF.compute.build_timeout
        }
        default_params_with_timeout_values.update(self.default_params)

        self.baremetal_client = BaremetalClient(
            self.auth_provider,
            CONF.baremetal.catalog_type,
            CONF.identity.region,
            endpoint_type=CONF.baremetal.endpoint_type,
            **default_params_with_timeout_values) 
开发者ID:openstack,项目名称:ironic-tempest-plugin,代码行数:27,代码来源:clients.py

示例2: validate_service

# 需要导入模块: from tempest import clients [as 别名]
# 或者: from tempest.clients import Manager [as 别名]
def validate_service(cls, service):
        """Validate whether the service passed to ``__init__`` exists."""
        service = service.lower().strip() if service else None

        # Cache the list of available services in memory to avoid needlessly
        # doing an API call every time.
        if not hasattr(cls, 'available_services'):
            admin_mgr = clients.Manager(
                credentials.get_configured_admin_credentials())
            services_client = (admin_mgr.identity_services_v3_client
                               if CONF.identity_feature_enabled.api_v3
                               else admin_mgr.identity_services_client)
            services = services_client.list_services()['services']
            cls.available_services = [s['name'] for s in services]

        if not service or service not in cls.available_services:
            LOG.debug("%s is NOT a valid service.", service)
            raise rbac_exceptions.RbacInvalidService(
                "%s is NOT a valid service." % service) 
开发者ID:openstack,项目名称:patrole,代码行数:21,代码来源:policy_authority.py

示例3: setUpClass

# 需要导入模块: from tempest import clients [as 别名]
# 或者: from tempest.clients import Manager [as 别名]
def setUpClass(cls):
        # Create no network resources for these test.
        cls.set_network_resources()
        super(BaseNetworkTest, cls).setUpClass()
        os = clients.Manager(interface=cls._interface)
        if not CONF.service_available.neutron:
            raise cls.skipException("Neutron support is required")
        cls.client = os.network_client
        cls.networks = []
        cls.subnets = []
        cls.ports = []
        cls.routers = []
        cls.pools = []
        cls.vips = []
        cls.members = []
        cls.health_monitors = []
        cls.vpnservices = []
        cls.ikepolicies = []
        cls.floating_ips = [] 
开发者ID:LIS,项目名称:LIS-Tempest,代码行数:21,代码来源:base.py

示例4: setUpClass

# 需要导入模块: from tempest import clients [as 别名]
# 或者: from tempest.clients import Manager [as 别名]
def setUpClass(cls):
        super(BaseVolumeV1AdminTest, cls).setUpClass()
        cls.adm_user = CONF.identity.admin_username
        cls.adm_pass = CONF.identity.admin_password
        cls.adm_tenant = CONF.identity.admin_tenant_name
        if not all((cls.adm_user, cls.adm_pass, cls.adm_tenant)):
            msg = ("Missing Volume Admin API credentials "
                   "in configuration.")
            raise cls.skipException(msg)
        if CONF.compute.allow_tenant_isolation:
            creds = cls.isolated_creds.get_admin_creds()
            admin_username, admin_tenant_name, admin_password = creds
            cls.os_adm = clients.Manager(username=admin_username,
                                         password=admin_password,
                                         tenant_name=admin_tenant_name,
                                         interface=cls._interface)
        else:
            cls.os_adm = clients.AdminManager(interface=cls._interface)
        cls.client = cls.os_adm.volume_types_client
        cls.hosts_client = cls.os_adm.volume_hosts_client 
开发者ID:LIS,项目名称:LIS-Tempest,代码行数:22,代码来源:base.py

示例5: setUpClass

# 需要导入模块: from tempest import clients [as 别名]
# 或者: from tempest.clients import Manager [as 别名]
def setUpClass(cls):
        super(CrossdomainTest, cls).setUpClass()
        # creates a test user. The test user will set its base_url to the Swift
        # endpoint and test the healthcheck feature.
        cls.data.setup_test_user()

        cls.os_test_user = clients.Manager(
            cls.data.test_user,
            cls.data.test_password,
            cls.data.test_tenant)

        cls.xml_start = '<?xml version="1.0"?>\n' \
                        '<!DOCTYPE cross-domain-policy SYSTEM ' \
                        '"http://www.adobe.com/xml/dtds/cross-domain-policy.' \
                        'dtd" >\n<cross-domain-policy>\n'

        cls.xml_end = "</cross-domain-policy>" 
开发者ID:LIS,项目名称:LIS-Tempest,代码行数:19,代码来源:test_crossdomain.py

示例6: setUpClass

# 需要导入模块: from tempest import clients [as 别名]
# 或者: from tempest.clients import Manager [as 别名]
def setUpClass(cls):
        super(BaseV2ComputeAdminTest, cls).setUpClass()
        admin_username = CONF.compute_admin.username
        admin_password = CONF.compute_admin.password
        admin_tenant = CONF.compute_admin.tenant_name
        if not (admin_username and admin_password and admin_tenant):
            msg = ("Missing Compute Admin API credentials "
                   "in configuration.")
            raise cls.skipException(msg)
        if (CONF.compute.allow_tenant_isolation or
            cls.force_tenant_isolation is True):
            creds = cls.isolated_creds.get_admin_creds()
            admin_username, admin_tenant_name, admin_password = creds
            cls.os_adm = clients.Manager(username=admin_username,
                                         password=admin_password,
                                         tenant_name=admin_tenant_name,
                                         interface=cls._interface)
        else:
            cls.os_adm = clients.ComputeAdminManager(interface=cls._interface) 
开发者ID:LIS,项目名称:LIS-Tempest,代码行数:21,代码来源:base.py

示例7: setUpClass

# 需要导入模块: from tempest import clients [as 别名]
# 或者: from tempest.clients import Manager [as 别名]
def setUpClass(cls):
        super(ImagesTestJSON, cls).setUpClass()
        if not CONF.service_available.glance:
            skip_msg = ("%s skipped as glance is not available" % cls.__name__)
            raise cls.skipException(skip_msg)
        cls.client = cls.images_client
        cls.servers_client = cls.servers_client

        cls.image_ids = []

        if cls.multi_user:
            if CONF.compute.allow_tenant_isolation:
                creds = cls.isolated_creds.get_alt_creds()
                username, tenant_name, password = creds
                cls.alt_manager = clients.Manager(username=username,
                                                  password=password,
                                                  tenant_name=tenant_name)
            else:
                # Use the alt_XXX credentials in the config file
                cls.alt_manager = clients.AltManager()
            cls.alt_client = cls.alt_manager.images_client 
开发者ID:LIS,项目名称:LIS-Tempest,代码行数:23,代码来源:test_images.py

示例8: setUpClass

# 需要导入模块: from tempest import clients [as 别名]
# 或者: from tempest.clients import Manager [as 别名]
def setUpClass(cls):
        cls.set_network_resources()
        super(BaseImageTest, cls).setUpClass()
        cls.created_images = []
        cls._interface = 'json'
        cls.isolated_creds = isolated_creds.IsolatedCreds(
            cls.__name__, network_resources=cls.network_resources)
        if not CONF.service_available.glance:
            skip_msg = ("%s skipped as glance is not available" % cls.__name__)
            raise cls.skipException(skip_msg)
        if CONF.compute.allow_tenant_isolation:
            creds = cls.isolated_creds.get_primary_creds()
            username, tenant_name, password = creds
            cls.os = clients.Manager(username=username,
                                     password=password,
                                     tenant_name=tenant_name)
        else:
            cls.os = clients.Manager() 
开发者ID:LIS,项目名称:LIS-Tempest,代码行数:20,代码来源:base.py

示例9: __init__

# 需要导入模块: from tempest import clients [as 别名]
# 或者: from tempest.clients import Manager [as 别名]
def __init__(self, credentials):
        super(Manager, self).__init__(credentials)

        self.auth_client = auth_client.AuthClient(self.auth_provider)
        self.identity_providers_client = (
            identity_providers_client.IdentityProvidersClient(
                self.auth_provider))
        self.mapping_rules_client = (
            mapping_rules_client.MappingRulesClient(
                self.auth_provider))
        self.saml2_client = saml2_client.Saml2Client()
        self.service_providers_client = (
            service_providers_client.ServiceProvidersClient(
                self.auth_provider)) 
开发者ID:openstack,项目名称:keystone-tempest-plugin,代码行数:16,代码来源:clients.py

示例10: __init__

# 需要导入模块: from tempest import clients [as 别名]
# 或者: from tempest.clients import Manager [as 别名]
def __init__(self,
                 credentials=ADMIN_CREDS,
                 api_microversions=None):
        super(Manager, self).__init__(credentials)
        self.introspection_client = BaremetalIntrospectionClient(
            self.auth_provider,
            CONF.baremetal_introspection.catalog_type,
            CONF.identity.region,
            endpoint_type=CONF.baremetal_introspection.endpoint_type) 
开发者ID:openstack,项目名称:ironic-tempest-plugin,代码行数:11,代码来源:introspection_client.py

示例11: __init__

# 需要导入模块: from tempest import clients [as 别名]
# 或者: from tempest.clients import Manager [as 别名]
def __init__(self, credentials=None):
        super(Manager, self).__init__(credentials)
        self.freezer_api_client = freezer_api_client.FreezerApiClient(
            self.auth_provider) 
开发者ID:openstack,项目名称:freezer-tempest-plugin,代码行数:6,代码来源:clients.py

示例12: setUp

# 需要导入模块: from tempest import clients [as 别名]
# 或者: from tempest.clients import Manager [as 别名]
def setUp(self):
        super(RbacUtilsFixture, self).setUp()

        self.useFixture(ConfPatcher(rbac_test_role='member', group='patrole'))
        self.useFixture(ConfPatcher(
            admin_role='admin', auth_version='v3', group='identity'))

        test_obj_kwargs = {
            'os_primary.credentials.user_id': self.USER_ID,
            'os_primary.credentials.tenant_id': self.PROJECT_ID,
            'os_primary.credentials.project_id': self.PROJECT_ID,
            'get_identity_version.return_value': 'v3'
        }
        self.mock_test_obj = mock.Mock(
            __name__='patrole_unit_test', spec=test.BaseTestCase,
            os_primary=mock.Mock(), **test_obj_kwargs)

        # Mock out functionality that can't be used by unit tests. Mocking out
        # time.sleep is a test optimization.
        self.mock_time = mock.patch.object(
            rbac_utils, 'time', __name__='mock_time', spec=time).start()
        mock.patch.object(credentials, 'get_configured_admin_credentials',
                          spec=object).start()
        mock_admin_mgr = mock.patch.object(
            clients, 'Manager', spec=clients.Manager,
            roles_v3_client=mock.Mock(), roles_client=mock.Mock()).start()
        self.roles_v3_client = mock_admin_mgr.return_value.roles_v3_client

        self.set_roles(['admin', 'member'], []) 
开发者ID:openstack,项目名称:patrole,代码行数:31,代码来源:fixtures.py

示例13: __init__

# 需要导入模块: from tempest import clients [as 别名]
# 或者: from tempest.clients import Manager [as 别名]
def __init__(self, test_obj):
        """Constructor for ``RbacUtils``.

        :param test_obj: An instance of `tempest.test.BaseTestCase`.
        """
        # Intialize the admin roles_client to perform role switching.
        admin_mgr = clients.Manager(
            credentials.get_configured_admin_credentials())
        if test_obj.get_identity_version() == 'v3':
            admin_roles_client = admin_mgr.roles_v3_client
        else:
            admin_roles_client = admin_mgr.roles_client

        self.admin_roles_client = admin_roles_client
        self._override_role(test_obj, False) 
开发者ID:openstack,项目名称:patrole,代码行数:17,代码来源:rbac_utils.py

示例14: _set_telemetry_clients

# 需要导入模块: from tempest import clients [as 别名]
# 或者: from tempest.clients import Manager [as 别名]
def _set_telemetry_clients(self):
        self.telemetry_client = telemetry_client.TelemetryClient(
            self.auth_provider, **telemetry_client.Manager.telemetry_params) 
开发者ID:openstack,项目名称:oswin-tempest-plugin,代码行数:5,代码来源:test_metrics_collection.py

示例15: __init__

# 需要导入模块: from tempest import clients [as 别名]
# 或者: from tempest.clients import Manager [as 别名]
def __init__(self, credentials=None):
        if credentials is None:
            global ADMIN_CREDS
            if ADMIN_CREDS is None:
                ADMIN_CREDS = common_creds.get_configured_admin_credentials()
            credentials = ADMIN_CREDS
        super(Manager, self).__init__(credentials)

        self.artifacts_client = artifacts_client.ArtifactsClient(
            self.auth_provider) 
开发者ID:openstack,项目名称:glare,代码行数:12,代码来源:clients.py


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