def setup_clients(cls):
        super(BaseApplicationCatalogScenarioTest, cls).setup_clients()
        if not hasattr(cls, "os_primary"):
            creds = cls.get_configured_isolated_creds(type_of_creds='primary')
            cls.os_primary = clients.Manager(credentials=creds)
            cls.services_manager = services_manager(creds)

        cls.application_catalog_client = \
            cls.os_primary.application_catalog_client
        cls.artifacts_client = cls.os_primary.artifacts_client
        cls.servers_client = cls.services_manager.servers_client
        params = {
            'disable_ssl_certificate_validation':
            CONF.identity.disable_ssl_certificate_validation,
            'ca_certs': CONF.identity.ca_certificates_file,
            'trace_requests': CONF.debug.trace_requests,
            'http_timeout': CONF.service_clients.http_timeout,
            'proxy_url': CONF.service_clients.proxy_url,
            'build_timeout': CONF.orchestration.build_timeout,
            'build_interval': CONF.orchestration.build_interval,
            'endpoint_type': CONF.orchestration.endpoint_type,
            'service': CONF.orchestration.catalog_type
        }
        options = getattr(CONF, 'orchestration')
        # Set region
        # If a service client does not define region or region is not set
        # default to the identity region
        if not hasattr(options, 'region') or not getattr(options, 'region'):
            params['region'] = CONF.identity.region
        else:
            params['region'] = getattr(options, 'region')
        cls.orchestration_client = orchestration.OrchestrationClient(
            cls.services_manager.auth_provider, **params)
        cls.images_client = cls.services_manager.image_client_v2
Beispiel #2
0
    def __init__(self, credentials, scope='project'):
        """Initialization of Manager class.

        Setup all services clients and make them available for tests cases.
        :param credentials: type Credentials or TestResources
        :param scope: default scope for tokens produced by the auth provider
        """
        _, identity_uri = get_auth_provider_class(credentials)
        super(Manager,
              self).__init__(credentials=credentials,
                             identity_uri=identity_uri,
                             scope=scope,
                             region=CONF.identity.region,
                             client_parameters=self._prepare_configuration())
        # TODO(andreaf) When clients are initialised without the right
        # parameters available, the calls below will trigger a KeyError.
        # We should catch that and raise a better error.
        self._set_compute_clients()
        self._set_identity_clients()
        self._set_volume_clients()
        self._set_object_storage_clients()
        self._set_image_clients()
        self._set_network_clients()

        self.orchestration_client = orchestration.OrchestrationClient(
            self.auth_provider,
            CONF.orchestration.catalog_type,
            CONF.orchestration.region or CONF.identity.region,
            endpoint_type=CONF.orchestration.endpoint_type,
            build_interval=CONF.orchestration.build_interval,
            build_timeout=CONF.orchestration.build_timeout,
            **self.default_params)
 def setup_clients(cls):
     super(NeutronRedirectionTargetsTest, cls).setup_clients()
     cls.orchestration_client = orchestration.OrchestrationClient(
         cls.os_primary.auth_provider,
         CONF.heat_plugin.catalog_type,
         CONF.heat_plugin.region or CONF.identity.region,
         build_interval=CONF.heat_plugin.build_interval,
         build_timeout=CONF.heat_plugin.build_timeout,
         **cls.os_primary.default_params)
Beispiel #4
0
    def setup_clients(cls):
        super(NuageBaseOrchestrationTest, cls).setup_clients()
        cls.vsd_client = nuage_client.NuageRestClient()

        # add ourselves for now as was removed upstream
        cls.orchestration_client = orchestration.OrchestrationClient(
            cls.os_admin.auth_provider,
            CONF.heat_plugin.catalog_type,
            CONF.heat_plugin.region or CONF.identity.region,
            build_interval=CONF.heat_plugin.build_interval,
            build_timeout=CONF.heat_plugin.build_timeout,
            **cls.os_admin.default_params)

        cls.admin_networks_client = cls.os_admin.networks_client
        cls.admin_routers_client = cls.os_admin.routers_client
Beispiel #5
0
    def setup_clients(cls):
        super(BaseApplicationCatalogScenarioTest, cls).setup_clients()
        if not hasattr(cls, "os_primary"):
            creds = cls.get_configured_isolated_creds(type_of_creds='primary')
            cls.os_primary = clients.Manager(credentials=creds)
            cls.services_manager = services_manager(creds)

        cls.application_catalog_client = \
            cls.os_primary.application_catalog_client
        cls.artifacts_client = cls.os_primary.artifacts_client
        cls.servers_client = cls.services_manager.servers_client
        # NOTE(andreaf) The orchestration client is not initialised in Tempest
        # by default anymore.
        params = config.service_client_config('orchestration')
        cls.orchestration_client = orchestration.OrchestrationClient(
            cls.services_manager.auth_provider, **params)
        cls.images_client = cls.services_manager.image_client_v2
Beispiel #6
0
    def setup_clients(cls):
        super(BaseOrchestrationTest, cls).setup_clients()

        # add ourselves for now as was removed upstream
        cls.orchestration_client = orchestration.OrchestrationClient(
            cls.os_admin.auth_provider,
            CONF.heat_plugin.catalog_type,
            CONF.heat_plugin.region or CONF.identity.region,
            build_interval=CONF.heat_plugin.build_interval,
            build_timeout=CONF.heat_plugin.build_timeout,
            **cls.os_admin.default_params)

        cls.client = cls.orchestration_client
        cls.servers_client = cls.os_admin.servers_client
        cls.keypairs_client = cls.os_admin.keypairs_client
        cls.networks_client = cls.os_admin.networks_client
        cls.images_v2_client = cls.os_admin.image_client_v2
        cls.volumes_client = cls.os_admin.volumes_v2_client