Best Python code snippet using tempest_python
clients.py
Source:clients.py
...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()...
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.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!