def __init__(self, user, pw, tenant): _creds = tempest.auth.KeystoneV2Credentials( username=user, password=pw, tenant_name=tenant) _auth = tempest.auth.KeystoneV2AuthProvider(_creds) self.identity = identity_client.IdentityClientJSON(_auth) self.servers = servers_client.ServersClientJSON(_auth) self.objects = object_client.ObjectClient(_auth) self.containers = container_client.ContainerClient(_auth) self.images = image_client.ImageClientV2JSON(_auth) self.flavors = flavors_client.FlavorsClientJSON(_auth)
def __init__(self, user, pw, tenant): _creds = tempest.auth.KeystoneV2Credentials(username=user, password=pw, tenant_name=tenant) _auth = tempest.auth.KeystoneV2AuthProvider(_creds) self.identity = identity_client.IdentityClientJSON(_auth) self.servers = servers_client.ServersClientJSON(_auth) self.objects = object_client.ObjectClient(_auth) self.containers = container_client.ContainerClient(_auth) self.images = image_client.ImageClientV2JSON(_auth) self.flavors = flavors_client.FlavorsClientJSON(_auth) self.telemetry = telemetry_client.TelemetryClientJSON(_auth) self.secgroups = security_groups_client.SecurityGroupsClientJSON(_auth) self.volumes = volumes_client.VolumesClientJSON(_auth) self.networks = network_client.NetworkClientJSON(_auth)
def __init__(self, user, pw, tenant): default_params = { 'disable_ssl_certificate_validation': CONF.identity.disable_ssl_certificate_validation, 'ca_certs': CONF.identity.ca_certificates_file, 'trace_requests': CONF.debug.trace_requests } compute_params = { 'service': CONF.compute.catalog_type, 'region': CONF.compute.region or CONF.identity.region, 'endpoint_type': CONF.compute.endpoint_type, 'build_interval': CONF.compute.build_interval, 'build_timeout': CONF.compute.build_timeout } compute_params.update(default_params) _creds = tempest.auth.KeystoneV2Credentials(username=user, password=pw, tenant_name=tenant) _auth = tempest.auth.KeystoneV2AuthProvider(_creds) self.identity = identity_client.IdentityClientJSON(_auth) self.servers = servers_client.ServersClientJSON( _auth, **compute_params) self.flavors = flavors_client.FlavorsClientJSON( _auth, **compute_params) self.secgroups = security_groups_client.SecurityGroupsClientJSON( _auth, **compute_params) self.objects = object_client.ObjectClient(_auth) self.containers = container_client.ContainerClient(_auth) self.images = image_client.ImageClientV2JSON(_auth) self.telemetry = telemetry_client.TelemetryClientJSON(_auth) self.volumes = volumes_client.VolumesClientJSON(_auth) self.networks = network_client.NetworkClientJSON( _auth, CONF.network.catalog_type, CONF.network.region or CONF.identity.region, endpoint_type=CONF.network.endpoint_type, build_interval=CONF.network.build_interval, build_timeout=CONF.network.build_timeout, **default_params)
def __init__(self, conf, admin): if admin: username = conf.get_defaulted('identity', 'admin_username') password = conf.get_defaulted('identity', 'admin_password') tenant_name = conf.get_defaulted('identity', 'admin_tenant_name') else: username = conf.get_defaulted('identity', 'username') password = conf.get_defaulted('identity', 'password') tenant_name = conf.get_defaulted('identity', 'tenant_name') self.identity_region = conf.get_defaulted('identity', 'region') default_params = { 'disable_ssl_certificate_validation': conf.get_defaulted('identity', 'disable_ssl_certificate_validation'), 'ca_certs': conf.get_defaulted('identity', 'ca_certificates_file') } compute_params = { 'service': conf.get_defaulted('compute', 'catalog_type'), 'region': self.identity_region, 'endpoint_type': conf.get_defaulted('compute', 'endpoint_type') } compute_params.update(default_params) _creds = tempest_lib.auth.KeystoneV2Credentials( username=username, password=password, tenant_name=tenant_name) auth_provider_params = { 'disable_ssl_certificate_validation': conf.get_defaulted('identity', 'disable_ssl_certificate_validation'), 'ca_certs': conf.get_defaulted('identity', 'ca_certificates_file') } _auth = tempest_lib.auth.KeystoneV2AuthProvider( _creds, conf.get_defaulted('identity', 'uri'), **auth_provider_params) self.auth_provider = _auth self.identity = identity_client.IdentityClientJSON( _auth, conf.get_defaulted('identity', 'catalog_type'), self.identity_region, endpoint_type='adminURL', **default_params) self.images = image_client.ImageClientV2JSON( _auth, conf.get_defaulted('image', 'catalog_type'), self.identity_region, conf.get_defaulted('image', 'endpoint_type'), **default_params) self.servers = servers_client.ServersClientJSON( _auth, **compute_params) self.flavors = flavors_client.FlavorsClientJSON( _auth, **compute_params) self.networks = None def create_nova_network_client(): if self.networks is None: self.networks = nova_net_client.NetworksClientJSON( _auth, **compute_params) return self.networks def create_neutron_client(): if self.networks is None: self.networks = network_client.NetworkClientJSON( _auth, conf.get_defaulted('network', 'catalog_type'), self.identity_region, endpoint_type=conf.get_defaulted('network', 'endpoint_type'), **default_params) return self.networks self.get_nova_net_client = create_nova_network_client self.get_neutron_client = create_neutron_client # Set admin tenant id needed for keystone v3 tests. if admin: tenant_id = self.identity.get_tenant_by_name(tenant_name)['id'] conf.set('identity', 'admin_tenant_id', tenant_id)