How to use _set_compute_clients method in tempest

Best Python code snippet using tempest_python

clients.py

Source:clients.py Github

copy

Full Screen

...37 client_parameters=self._prepare_configuration())38 # TODO(andreaf) When clients are initialised without the right39 # parameters available, the calls below will trigger a KeyError.40 # We should catch that and raise a better error.41 self._set_compute_clients()42 self._set_identity_clients()43 self._set_volume_clients()44 self._set_object_storage_clients()45 self._set_image_clients()46 self._set_network_clients()47 self.orchestration_client = orchestration.OrchestrationClient(48 self.auth_provider,49 CONF.orchestration.catalog_type,50 CONF.orchestration.region or CONF.identity.region,51 endpoint_type=CONF.orchestration.endpoint_type,52 build_interval=CONF.orchestration.build_interval,53 build_timeout=CONF.orchestration.build_timeout,54 **self.default_params)55 def _prepare_configuration(self):56 """Map values from CONF into Manager parameters57 This uses `config.service_client_config` for all services to collect58 most configuration items needed to init the clients.59 """60 # NOTE(andreaf) Once all service clients in Tempest are migrated61 # to tempest.lib, their configuration will be picked up from the62 # registry, and this method will become redundant.63 configuration = {}64 # Setup the parameters for all Tempest services which are not in lib.65 # NOTE(andreaf) Since client.py is an internal module of Tempest,66 # it doesn't have to consider plugin configuration.67 for service in clients._tempest_internal_modules():68 try:69 # NOTE(andreaf) Use the unversioned service name to fetch70 # the configuration since configuration is not versioned.71 service_for_config = service.split('.')[0]72 if service_for_config not in configuration:73 configuration[service_for_config] = (74 config.service_client_config(service_for_config))75 except lib_exc.UnknownServiceClient:76 LOG.warning(77 'Could not load configuration for service %s', service)78 return configuration79 def _set_network_clients(self):80 self.network_agents_client = self.network.AgentsClient()81 self.network_extensions_client = self.network.ExtensionsClient()82 self.networks_client = self.network.NetworksClient()83 self.subnetpools_client = self.network.SubnetpoolsClient()84 self.subnets_client = self.network.SubnetsClient()85 self.ports_client = self.network.PortsClient()86 self.network_quotas_client = self.network.QuotasClient()87 self.floating_ips_client = self.network.FloatingIPsClient()88 self.metering_labels_client = self.network.MeteringLabelsClient()89 self.metering_label_rules_client = (90 self.network.MeteringLabelRulesClient())91 self.routers_client = self.network.RoutersClient()92 self.security_group_rules_client = (93 self.network.SecurityGroupRulesClient())94 self.security_groups_client = self.network.SecurityGroupsClient()95 self.network_versions_client = self.network.NetworkVersionsClient()96 self.service_providers_client = self.network.ServiceProvidersClient()97 def _set_image_clients(self):98 if CONF.service_available.glance:99 self.image_client = self.image_v1.ImagesClient()100 self.image_member_client = self.image_v1.ImageMembersClient()101 self.image_client_v2 = self.image_v2.ImagesClient()102 self.image_member_client_v2 = self.image_v2.ImageMembersClient()103 self.namespaces_client = self.image_v2.NamespacesClient()104 self.resource_types_client = self.image_v2.ResourceTypesClient()105 self.namespace_objects_client = \106 self.image_v2.NamespaceObjectsClient()107 self.schemas_client = self.image_v2.SchemasClient()108 self.namespace_properties_client = \109 self.image_v2.NamespacePropertiesClient()110 self.namespace_tags_client = \111 self.image_v2.NamespaceTagsClient()112 def _set_compute_clients(self):113 self.agents_client = self.compute.AgentsClient()114 self.compute_networks_client = self.compute.NetworksClient()115 self.migrations_client = self.compute.MigrationsClient()116 self.security_group_default_rules_client = (117 self.compute.SecurityGroupDefaultRulesClient())118 self.certificates_client = self.compute.CertificatesClient()119 eip = CONF.compute_feature_enabled.enable_instance_password120 self.servers_client = self.compute.ServersClient(121 enable_instance_password=eip)122 self.server_groups_client = self.compute.ServerGroupsClient()123 self.limits_client = self.compute.LimitsClient()124 self.compute_images_client = self.compute.ImagesClient()125 self.keypairs_client = self.compute.KeyPairsClient()126 self.quotas_client = self.compute.QuotasClient()...

Full Screen

Full Screen

sf_clients.py

Source:sf_clients.py Github

copy

Full Screen

...39 def __init__(self, credentials=None, service=None):40 super(SfManager, self).__init__(credentials=credentials,41 service=service)42 self._set_sf_notify_client()43 self._set_compute_clients()44 self._set_sfprocess_client()45 self._set_billcenter_client()46 self._set_sfpool_client()47 def _set_sf_notify_client(self):48 params = {49 'service': CONF.sf_notify.catalog_type,50 'region': CONF.sf_notify.region or CONF.identity.region,51 'endpoint_type': CONF.sf_notify.endpoint_type52 }53 params.update(self.default_params)54 self.sf_notify_email_client = SfNotifyEmailClient(self.auth_provider,55 **params)56 self.sf_notify_sms_client = SfNotifySmsClient(self.auth_provider,57 **params)58 def _set_compute_clients(self):59 super(SfManager, self)._set_compute_clients()60 params = {61 'service': CONF.compute.catalog_type,62 'region': CONF.compute.region or CONF.identity.region,63 'endpoint_type': CONF.compute.endpoint_type,64 'build_interval': CONF.compute.build_interval,65 'build_timeout': CONF.compute.build_timeout66 }67 params.update(self.default_params)68 self.sf_snapshot_client = SfSnapshotClient(self.auth_provider,69 **params)70 self.sf_tenant_networks_client = SfTenantNetworksClient(71 self.auth_provider, **params)72 def _set_sfprocess_client(self):73 params = {...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run tempest automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful