Merge "Convert all service clients to global CONF object"
diff --git a/tempest/clients.py b/tempest/clients.py
index d0a1491..797185a 100644
--- a/tempest/clients.py
+++ b/tempest/clients.py
@@ -184,7 +184,6 @@
:param password: Override of the password
:param tenant_name: Override of the tenant name
"""
- self.config = CONF
# If no creds are provided, we fall back on the defaults
# in the config file for the Compute API.
self.username = username or CONF.identity.username
@@ -201,12 +200,12 @@
self.auth_url = CONF.identity.uri
self.auth_url_v3 = CONF.identity.uri_v3
- client_args = (CONF, self.username, self.password,
+ client_args = (self.username, self.password,
self.auth_url, self.tenant_name)
if self.auth_url_v3:
auth_version = 'v3'
- client_args_v3_auth = (CONF, self.username,
+ client_args_v3_auth = (self.username,
self.password, self.auth_url_v3,
self.tenant_name, auth_version)
else:
@@ -231,7 +230,7 @@
self.volume_types_client = VolumeTypesClientXML(*client_args)
self.identity_client = IdentityClientXML(*client_args)
self.identity_v3_client = IdentityV3ClientXML(*client_args)
- self.token_client = TokenClientXML(CONF)
+ self.token_client = TokenClientXML()
self.security_groups_client = SecurityGroupsClientXML(
*client_args)
self.interfaces_client = InterfacesClientXML(*client_args)
@@ -287,7 +286,7 @@
self.volume_types_client = VolumeTypesClientJSON(*client_args)
self.identity_client = IdentityClientJSON(*client_args)
self.identity_v3_client = IdentityV3ClientJSON(*client_args)
- self.token_client = TokenClientJSON(CONF)
+ self.token_client = TokenClientJSON()
self.security_groups_client = SecurityGroupsClientJSON(
*client_args)
self.interfaces_v3_client = InterfacesV3ClientJSON(*client_args)
diff --git a/tempest/common/rest_client.py b/tempest/common/rest_client.py
index b1fef99..636e2bf 100644
--- a/tempest/common/rest_client.py
+++ b/tempest/common/rest_client.py
@@ -22,10 +22,13 @@
import time
from tempest.common import http
+from tempest import config
from tempest import exceptions
from tempest.openstack.common import log as logging
from tempest.services.compute.xml.common import xml_to_json
+CONF = config.CONF
+
# redrive rate limited calls at most twice
MAX_RECURSION_DEPTH = 2
TOKEN_CHARS_RE = re.compile('^[-A-Za-z0-9+/=]*$')
@@ -38,9 +41,8 @@
TYPE = "json"
LOG = logging.getLogger(__name__)
- def __init__(self, config, user, password, auth_url, tenant_name=None,
+ def __init__(self, user, password, auth_url, tenant_name=None,
auth_version='v2'):
- self.config = config
self.user = user
self.password = password
self.auth_url = auth_url
@@ -51,21 +53,21 @@
self.token = None
self.base_url = None
self.region = {}
- for cfgname in dir(self.config):
+ for cfgname in dir(CONF):
# Find all config.FOO.catalog_type and assume FOO is a service.
- cfg = getattr(self.config, cfgname)
+ cfg = getattr(CONF, cfgname)
catalog_type = getattr(cfg, 'catalog_type', None)
if not catalog_type:
continue
service_region = getattr(cfg, 'region', None)
if not service_region:
- service_region = self.config.identity.region
+ service_region = CONF.identity.region
self.region[catalog_type] = service_region
self.endpoint_url = 'publicURL'
self.headers = {'Content-Type': 'application/%s' % self.TYPE,
'Accept': 'application/%s' % self.TYPE}
- self.build_interval = config.compute.build_interval
- self.build_timeout = config.compute.build_timeout
+ self.build_interval = CONF.compute.build_interval
+ self.build_timeout = CONF.compute.build_timeout
self.general_header_lc = set(('cache-control', 'connection',
'date', 'pragma', 'trailer',
'transfer-encoding', 'via',
@@ -74,18 +76,18 @@
'location', 'proxy-authenticate',
'retry-after', 'server',
'vary', 'www-authenticate'))
- dscv = self.config.identity.disable_ssl_certificate_validation
+ dscv = CONF.identity.disable_ssl_certificate_validation
self.http_obj = http.ClosingHttp(
disable_ssl_certificate_validation=dscv)
def __str__(self):
STRING_LIMIT = 80
- str_format = ("config:%s, user:%s, password:%s, "
+ str_format = ("user:%s, password:%s, "
"auth_url:%s, tenant_name:%s, auth_version:%s, "
"service:%s, base_url:%s, region:%s, "
"endpoint_url:%s, build_interval:%s, build_timeout:%s"
"\ntoken:%s..., \nheaders:%s...")
- return str_format % (self.config, self.user, self.password,
+ return str_format % (self.user, self.password,
self.auth_url, self.tenant_name,
self.auth_version, self.service,
self.base_url, self.region, self.endpoint_url,
diff --git a/tempest/services/baremetal/base.py b/tempest/services/baremetal/base.py
index 74d023a..0b5426e 100644
--- a/tempest/services/baremetal/base.py
+++ b/tempest/services/baremetal/base.py
@@ -16,6 +16,9 @@
import six
from tempest.common import rest_client
+from tempest import config
+
+CONF = config.CONF
def handle_errors(f):
@@ -44,10 +47,10 @@
"""
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(BaremetalClient, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(BaremetalClient, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.baremetal.catalog_type
+ self.service = CONF.baremetal.catalog_type
self.uri_prefix = ''
def serialize(self, object_type, object_dict):
diff --git a/tempest/services/baremetal/v1/base_v1.py b/tempest/services/baremetal/v1/base_v1.py
index 5e90cd6..13693e1 100644
--- a/tempest/services/baremetal/v1/base_v1.py
+++ b/tempest/services/baremetal/v1/base_v1.py
@@ -21,8 +21,8 @@
methods in order to send requests to Ironic.
"""
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(BaremetalClientV1, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(BaremetalClientV1, self).__init__(username, password,
auth_url, tenant_name)
self.version = '1'
self.uri_prefix = 'v%s' % self.version
diff --git a/tempest/services/baremetal/v1/client_json.py b/tempest/services/baremetal/v1/client_json.py
index f1708af..c98b20f 100644
--- a/tempest/services/baremetal/v1/client_json.py
+++ b/tempest/services/baremetal/v1/client_json.py
@@ -18,8 +18,8 @@
class BaremetalClientJSON(base_v1.BaremetalClientV1):
"""Tempest REST client for Ironic JSON API v1."""
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(BaremetalClientJSON, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(BaremetalClientJSON, self).__init__(username, password,
auth_url, tenant_name)
self.serialize = lambda obj_type, obj_body: json.dumps(obj_body)
diff --git a/tempest/services/botoclients.py b/tempest/services/botoclients.py
index a1e1b5c..03e87b1 100644
--- a/tempest/services/botoclients.py
+++ b/tempest/services/botoclients.py
@@ -18,25 +18,27 @@
import types
import urlparse
+from tempest import config
from tempest import exceptions
import boto
import boto.ec2
import boto.s3.connection
+CONF = config.CONF
+
class BotoClientBase(object):
ALLOWED_METHODS = set()
- def __init__(self, config,
- username=None, password=None,
+ def __init__(self, username=None, password=None,
auth_url=None, tenant_name=None,
*args, **kwargs):
- self.connection_timeout = str(config.boto.http_socket_timeout)
- self.num_retries = str(config.boto.num_retries)
- self.build_timeout = config.boto.build_timeout
+ self.connection_timeout = str(CONF.boto.http_socket_timeout)
+ self.num_retries = str(CONF.boto.num_retries)
+ self.build_timeout = CONF.boto.build_timeout
self.ks_cred = {"username": username,
"password": password,
"auth_url": auth_url,
@@ -103,15 +105,15 @@
def connect_method(self, *args, **kwargs):
return boto.connect_ec2(*args, **kwargs)
- def __init__(self, config, *args, **kwargs):
- super(APIClientEC2, self).__init__(config, *args, **kwargs)
- aws_access = config.boto.aws_access
- aws_secret = config.boto.aws_secret
- purl = urlparse.urlparse(config.boto.ec2_url)
+ def __init__(self, *args, **kwargs):
+ super(APIClientEC2, self).__init__(*args, **kwargs)
+ aws_access = CONF.boto.aws_access
+ aws_secret = CONF.boto.aws_secret
+ purl = urlparse.urlparse(CONF.boto.ec2_url)
- region_name = config.compute.region
+ region_name = CONF.compute.region
if not region_name:
- region_name = config.identity.region
+ region_name = CONF.identity.region
region = boto.ec2.regioninfo.RegionInfo(name=region_name,
endpoint=purl.hostname)
port = purl.port
@@ -194,11 +196,11 @@
def connect_method(self, *args, **kwargs):
return boto.connect_s3(*args, **kwargs)
- def __init__(self, config, *args, **kwargs):
- super(ObjectClientS3, self).__init__(config, *args, **kwargs)
- aws_access = config.boto.aws_access
- aws_secret = config.boto.aws_secret
- purl = urlparse.urlparse(config.boto.s3_url)
+ def __init__(self, *args, **kwargs):
+ super(ObjectClientS3, self).__init__(*args, **kwargs)
+ aws_access = CONF.boto.aws_access
+ aws_secret = CONF.boto.aws_secret
+ purl = urlparse.urlparse(CONF.boto.s3_url)
port = purl.port
if port is None:
if purl.scheme is not "https":
diff --git a/tempest/services/compute/json/aggregates_client.py b/tempest/services/compute/json/aggregates_client.py
index d9e73de..235d006 100644
--- a/tempest/services/compute/json/aggregates_client.py
+++ b/tempest/services/compute/json/aggregates_client.py
@@ -16,15 +16,18 @@
import json
from tempest.common.rest_client import RestClient
+from tempest import config
from tempest import exceptions
+CONF = config.CONF
+
class AggregatesClientJSON(RestClient):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(AggregatesClientJSON, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(AggregatesClientJSON, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.compute.catalog_type
+ self.service = CONF.compute.catalog_type
def list_aggregates(self):
"""Get aggregate list."""
diff --git a/tempest/services/compute/json/availability_zone_client.py b/tempest/services/compute/json/availability_zone_client.py
index 49664c7..2b7e23c 100644
--- a/tempest/services/compute/json/availability_zone_client.py
+++ b/tempest/services/compute/json/availability_zone_client.py
@@ -16,15 +16,18 @@
import json
from tempest.common.rest_client import RestClient
+from tempest import config
+
+CONF = config.CONF
class AvailabilityZoneClientJSON(RestClient):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(AvailabilityZoneClientJSON, self).__init__(config, username,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(AvailabilityZoneClientJSON, self).__init__(username,
password, auth_url,
tenant_name)
- self.service = self.config.compute.catalog_type
+ self.service = CONF.compute.catalog_type
def get_availability_zone_list(self):
resp, body = self.get('os-availability-zone')
diff --git a/tempest/services/compute/json/certificates_client.py b/tempest/services/compute/json/certificates_client.py
index f4d31ed..06e2ae7 100644
--- a/tempest/services/compute/json/certificates_client.py
+++ b/tempest/services/compute/json/certificates_client.py
@@ -16,15 +16,18 @@
import json
from tempest.common.rest_client import RestClient
+from tempest import config
+
+CONF = config.CONF
class CertificatesClientJSON(RestClient):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(CertificatesClientJSON, self).__init__(config, username,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(CertificatesClientJSON, self).__init__(username,
password,
auth_url, tenant_name)
- self.service = self.config.compute.catalog_type
+ self.service = CONF.compute.catalog_type
def get_certificate(self, id):
url = "os-certificates/%s" % (id)
diff --git a/tempest/services/compute/json/extensions_client.py b/tempest/services/compute/json/extensions_client.py
index ae68261..8505d93 100644
--- a/tempest/services/compute/json/extensions_client.py
+++ b/tempest/services/compute/json/extensions_client.py
@@ -16,14 +16,17 @@
import json
from tempest.common.rest_client import RestClient
+from tempest import config
+
+CONF = config.CONF
class ExtensionsClientJSON(RestClient):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(ExtensionsClientJSON, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(ExtensionsClientJSON, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.compute.catalog_type
+ self.service = CONF.compute.catalog_type
def list_extensions(self):
url = 'extensions'
diff --git a/tempest/services/compute/json/fixed_ips_client.py b/tempest/services/compute/json/fixed_ips_client.py
index 31754ca..19bf4e2 100644
--- a/tempest/services/compute/json/fixed_ips_client.py
+++ b/tempest/services/compute/json/fixed_ips_client.py
@@ -16,14 +16,17 @@
import json
from tempest.common.rest_client import RestClient
+from tempest import config
+
+CONF = config.CONF
class FixedIPsClientJSON(RestClient):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(FixedIPsClientJSON, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(FixedIPsClientJSON, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.compute.catalog_type
+ self.service = CONF.compute.catalog_type
def get_fixed_ip_details(self, fixed_ip):
url = "os-fixed-ips/%s" % (fixed_ip)
diff --git a/tempest/services/compute/json/flavors_client.py b/tempest/services/compute/json/flavors_client.py
index 300a0de..7fcf1b2 100644
--- a/tempest/services/compute/json/flavors_client.py
+++ b/tempest/services/compute/json/flavors_client.py
@@ -17,14 +17,17 @@
import urllib
from tempest.common.rest_client import RestClient
+from tempest import config
+
+CONF = config.CONF
class FlavorsClientJSON(RestClient):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(FlavorsClientJSON, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(FlavorsClientJSON, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.compute.catalog_type
+ self.service = CONF.compute.catalog_type
def list_flavors(self, params=None):
url = 'flavors'
diff --git a/tempest/services/compute/json/floating_ips_client.py b/tempest/services/compute/json/floating_ips_client.py
index 1235dd1..7c2139d 100644
--- a/tempest/services/compute/json/floating_ips_client.py
+++ b/tempest/services/compute/json/floating_ips_client.py
@@ -17,14 +17,17 @@
import urllib
from tempest.common.rest_client import RestClient
+from tempest import config
from tempest import exceptions
+CONF = config.CONF
+
class FloatingIPsClientJSON(RestClient):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(FloatingIPsClientJSON, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(FloatingIPsClientJSON, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.compute.catalog_type
+ self.service = CONF.compute.catalog_type
def list_floating_ips(self, params=None):
"""Returns a list of all floating IPs filtered by any parameters."""
diff --git a/tempest/services/compute/json/hosts_client.py b/tempest/services/compute/json/hosts_client.py
index 23cb7e9..33e5345 100644
--- a/tempest/services/compute/json/hosts_client.py
+++ b/tempest/services/compute/json/hosts_client.py
@@ -16,14 +16,17 @@
import urllib
from tempest.common.rest_client import RestClient
+from tempest import config
+
+CONF = config.CONF
class HostsClientJSON(RestClient):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(HostsClientJSON, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(HostsClientJSON, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.compute.catalog_type
+ self.service = CONF.compute.catalog_type
def list_hosts(self, params=None):
"""Lists all hosts."""
diff --git a/tempest/services/compute/json/hypervisor_client.py b/tempest/services/compute/json/hypervisor_client.py
index c8ac951..a4d8660 100644
--- a/tempest/services/compute/json/hypervisor_client.py
+++ b/tempest/services/compute/json/hypervisor_client.py
@@ -16,15 +16,18 @@
import json
from tempest.common.rest_client import RestClient
+from tempest import config
+
+CONF = config.CONF
class HypervisorClientJSON(RestClient):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(HypervisorClientJSON, self).__init__(config, username,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(HypervisorClientJSON, self).__init__(username,
password, auth_url,
tenant_name)
- self.service = self.config.compute.catalog_type
+ self.service = CONF.compute.catalog_type
def get_hypervisor_list(self):
"""List hypervisors information."""
diff --git a/tempest/services/compute/json/images_client.py b/tempest/services/compute/json/images_client.py
index d64d8d7..c9adc3f 100644
--- a/tempest/services/compute/json/images_client.py
+++ b/tempest/services/compute/json/images_client.py
@@ -18,17 +18,20 @@
from tempest.common.rest_client import RestClient
from tempest.common import waiters
+from tempest import config
from tempest import exceptions
+CONF = config.CONF
+
class ImagesClientJSON(RestClient):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(ImagesClientJSON, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(ImagesClientJSON, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.compute.catalog_type
- self.build_interval = self.config.compute.build_interval
- self.build_timeout = self.config.compute.build_timeout
+ self.service = CONF.compute.catalog_type
+ self.build_interval = CONF.compute.build_interval
+ self.build_timeout = CONF.compute.build_timeout
def create_image(self, server_id, name, meta=None):
"""Creates an image of the original server."""
diff --git a/tempest/services/compute/json/instance_usage_audit_log_client.py b/tempest/services/compute/json/instance_usage_audit_log_client.py
index 97062cb..2673bd7 100644
--- a/tempest/services/compute/json/instance_usage_audit_log_client.py
+++ b/tempest/services/compute/json/instance_usage_audit_log_client.py
@@ -16,14 +16,17 @@
import json
from tempest.common.rest_client import RestClient
+from tempest import config
+
+CONF = config.CONF
class InstanceUsagesAuditLogClientJSON(RestClient):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
+ def __init__(self, username, password, auth_url, tenant_name=None):
super(InstanceUsagesAuditLogClientJSON, self).__init__(
- config, username, password, auth_url, tenant_name)
- self.service = self.config.compute.catalog_type
+ username, password, auth_url, tenant_name)
+ self.service = CONF.compute.catalog_type
def list_instance_usage_audit_logs(self):
url = 'os-instance_usage_audit_log'
diff --git a/tempest/services/compute/json/interfaces_client.py b/tempest/services/compute/json/interfaces_client.py
index 06e6476..21d3a5a 100644
--- a/tempest/services/compute/json/interfaces_client.py
+++ b/tempest/services/compute/json/interfaces_client.py
@@ -17,15 +17,18 @@
import time
from tempest.common.rest_client import RestClient
+from tempest import config
from tempest import exceptions
+CONF = config.CONF
+
class InterfacesClientJSON(RestClient):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(InterfacesClientJSON, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(InterfacesClientJSON, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.compute.catalog_type
+ self.service = CONF.compute.catalog_type
def list_interfaces(self, server):
resp, body = self.get('servers/%s/os-interface' % server)
diff --git a/tempest/services/compute/json/keypairs_client.py b/tempest/services/compute/json/keypairs_client.py
index efd92d2..dd4e3e1 100644
--- a/tempest/services/compute/json/keypairs_client.py
+++ b/tempest/services/compute/json/keypairs_client.py
@@ -16,14 +16,17 @@
import json
from tempest.common.rest_client import RestClient
+from tempest import config
+
+CONF = config.CONF
class KeyPairsClientJSON(RestClient):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(KeyPairsClientJSON, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(KeyPairsClientJSON, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.compute.catalog_type
+ self.service = CONF.compute.catalog_type
def list_keypairs(self):
resp, body = self.get("os-keypairs")
diff --git a/tempest/services/compute/json/limits_client.py b/tempest/services/compute/json/limits_client.py
index 525c12f..c5cc988 100644
--- a/tempest/services/compute/json/limits_client.py
+++ b/tempest/services/compute/json/limits_client.py
@@ -14,15 +14,19 @@
# under the License.
import json
+
from tempest.common.rest_client import RestClient
+from tempest import config
+
+CONF = config.CONF
class LimitsClientJSON(RestClient):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(LimitsClientJSON, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(LimitsClientJSON, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.compute.catalog_type
+ self.service = CONF.compute.catalog_type
def get_absolute_limits(self):
resp, body = self.get("limits")
diff --git a/tempest/services/compute/json/quotas_client.py b/tempest/services/compute/json/quotas_client.py
index b6ec9b8..df12467 100644
--- a/tempest/services/compute/json/quotas_client.py
+++ b/tempest/services/compute/json/quotas_client.py
@@ -16,14 +16,17 @@
import json
from tempest.common.rest_client import RestClient
+from tempest import config
+
+CONF = config.CONF
class QuotasClientJSON(RestClient):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(QuotasClientJSON, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(QuotasClientJSON, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.compute.catalog_type
+ self.service = CONF.compute.catalog_type
def get_quota_set(self, tenant_id):
"""List the quota set for a tenant."""
diff --git a/tempest/services/compute/json/security_groups_client.py b/tempest/services/compute/json/security_groups_client.py
index 8a44626..299a6e6 100644
--- a/tempest/services/compute/json/security_groups_client.py
+++ b/tempest/services/compute/json/security_groups_client.py
@@ -17,16 +17,19 @@
import urllib
from tempest.common.rest_client import RestClient
+from tempest import config
from tempest import exceptions
+CONF = config.CONF
+
class SecurityGroupsClientJSON(RestClient):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(SecurityGroupsClientJSON, self).__init__(config, username,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(SecurityGroupsClientJSON, self).__init__(username,
password, auth_url,
tenant_name)
- self.service = self.config.compute.catalog_type
+ self.service = CONF.compute.catalog_type
def list_security_groups(self, params=None):
"""List all security groups for a user."""
diff --git a/tempest/services/compute/json/servers_client.py b/tempest/services/compute/json/servers_client.py
index 0b9ca0e..0987f05 100644
--- a/tempest/services/compute/json/servers_client.py
+++ b/tempest/services/compute/json/servers_client.py
@@ -20,17 +20,20 @@
from tempest.common.rest_client import RestClient
from tempest.common import waiters
+from tempest import config
from tempest import exceptions
+CONF = config.CONF
+
class ServersClientJSON(RestClient):
- def __init__(self, config, username, password, auth_url, tenant_name=None,
+ def __init__(self, username, password, auth_url, tenant_name=None,
auth_version='v2'):
- super(ServersClientJSON, self).__init__(config, username, password,
+ super(ServersClientJSON, self).__init__(username, password,
auth_url, tenant_name,
auth_version=auth_version)
- self.service = self.config.compute.catalog_type
+ self.service = CONF.compute.catalog_type
def create_server(self, name, image_ref, flavor_ref, **kwargs):
"""
diff --git a/tempest/services/compute/json/services_client.py b/tempest/services/compute/json/services_client.py
index 7829e5a..c209cf3 100644
--- a/tempest/services/compute/json/services_client.py
+++ b/tempest/services/compute/json/services_client.py
@@ -18,14 +18,17 @@
import urllib
from tempest.common.rest_client import RestClient
+from tempest import config
+
+CONF = config.CONF
class ServicesClientJSON(RestClient):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(ServicesClientJSON, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(ServicesClientJSON, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.compute.catalog_type
+ self.service = CONF.compute.catalog_type
def list_services(self, params=None):
url = 'os-services'
diff --git a/tempest/services/compute/json/tenant_usages_client.py b/tempest/services/compute/json/tenant_usages_client.py
index a263767..c141fa7 100644
--- a/tempest/services/compute/json/tenant_usages_client.py
+++ b/tempest/services/compute/json/tenant_usages_client.py
@@ -17,14 +17,17 @@
import urllib
from tempest.common.rest_client import RestClient
+from tempest import config
+
+CONF = config.CONF
class TenantUsagesClientJSON(RestClient):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
+ def __init__(self, username, password, auth_url, tenant_name=None):
super(TenantUsagesClientJSON, self).__init__(
- config, username, password, auth_url, tenant_name)
- self.service = self.config.compute.catalog_type
+ username, password, auth_url, tenant_name)
+ self.service = CONF.compute.catalog_type
def list_tenant_usages(self, params=None):
url = 'os-simple-tenant-usage'
diff --git a/tempest/services/compute/json/volumes_extensions_client.py b/tempest/services/compute/json/volumes_extensions_client.py
index aa49be5..d61b8a5 100644
--- a/tempest/services/compute/json/volumes_extensions_client.py
+++ b/tempest/services/compute/json/volumes_extensions_client.py
@@ -18,18 +18,21 @@
import urllib
from tempest.common.rest_client import RestClient
+from tempest import config
from tempest import exceptions
+CONF = config.CONF
+
class VolumesExtensionsClientJSON(RestClient):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(VolumesExtensionsClientJSON, self).__init__(config, username,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(VolumesExtensionsClientJSON, self).__init__(username,
password, auth_url,
tenant_name)
- self.service = self.config.compute.catalog_type
- self.build_interval = self.config.volume.build_interval
- self.build_timeout = self.config.volume.build_timeout
+ self.service = CONF.compute.catalog_type
+ self.build_interval = CONF.volume.build_interval
+ self.build_timeout = CONF.volume.build_timeout
def list_volumes(self, params=None):
"""List all the volumes created."""
diff --git a/tempest/services/compute/v3/json/aggregates_client.py b/tempest/services/compute/v3/json/aggregates_client.py
index d63be02..bc037c9 100644
--- a/tempest/services/compute/v3/json/aggregates_client.py
+++ b/tempest/services/compute/v3/json/aggregates_client.py
@@ -16,16 +16,19 @@
import json
from tempest.common.rest_client import RestClient
+from tempest import config
from tempest import exceptions
+CONF = config.CONF
+
class AggregatesV3ClientJSON(RestClient):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(AggregatesV3ClientJSON, self).__init__(config, username,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(AggregatesV3ClientJSON, self).__init__(username,
password, auth_url,
tenant_name)
- self.service = self.config.compute.catalog_v3_type
+ self.service = CONF.compute.catalog_v3_type
def list_aggregates(self):
"""Get aggregate list."""
diff --git a/tempest/services/compute/v3/json/availability_zone_client.py b/tempest/services/compute/v3/json/availability_zone_client.py
index 97ff21c..a3f4d94 100644
--- a/tempest/services/compute/v3/json/availability_zone_client.py
+++ b/tempest/services/compute/v3/json/availability_zone_client.py
@@ -16,15 +16,18 @@
import json
from tempest.common.rest_client import RestClient
+from tempest import config
+
+CONF = config.CONF
class AvailabilityZoneV3ClientJSON(RestClient):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(AvailabilityZoneV3ClientJSON, self).__init__(config, username,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(AvailabilityZoneV3ClientJSON, self).__init__(username,
password, auth_url,
tenant_name)
- self.service = self.config.compute.catalog_v3_type
+ self.service = CONF.compute.catalog_v3_type
def get_availability_zone_list(self):
resp, body = self.get('os-availability-zone')
diff --git a/tempest/services/compute/v3/json/certificates_client.py b/tempest/services/compute/v3/json/certificates_client.py
index 7c21290..1833cb9 100644
--- a/tempest/services/compute/v3/json/certificates_client.py
+++ b/tempest/services/compute/v3/json/certificates_client.py
@@ -16,15 +16,18 @@
import json
from tempest.common.rest_client import RestClient
+from tempest import config
+
+CONF = config.CONF
class CertificatesV3ClientJSON(RestClient):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(CertificatesV3ClientJSON, self).__init__(config, username,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(CertificatesV3ClientJSON, self).__init__(username,
password,
auth_url, tenant_name)
- self.service = self.config.compute.catalog_v3_type
+ self.service = CONF.compute.catalog_v3_type
def get_certificate(self, id):
url = "os-certificates/%s" % (id)
diff --git a/tempest/services/compute/v3/json/extensions_client.py b/tempest/services/compute/v3/json/extensions_client.py
index c508d2f..f760093 100644
--- a/tempest/services/compute/v3/json/extensions_client.py
+++ b/tempest/services/compute/v3/json/extensions_client.py
@@ -16,15 +16,18 @@
import json
from tempest.common.rest_client import RestClient
+from tempest import config
+
+CONF = config.CONF
class ExtensionsV3ClientJSON(RestClient):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(ExtensionsV3ClientJSON, self).__init__(config, username,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(ExtensionsV3ClientJSON, self).__init__(username,
password, auth_url,
tenant_name)
- self.service = self.config.compute.catalog_v3_type
+ self.service = CONF.compute.catalog_v3_type
def list_extensions(self):
url = 'extensions'
diff --git a/tempest/services/compute/v3/json/flavors_client.py b/tempest/services/compute/v3/json/flavors_client.py
index 739c870..d8a54a6 100644
--- a/tempest/services/compute/v3/json/flavors_client.py
+++ b/tempest/services/compute/v3/json/flavors_client.py
@@ -17,14 +17,17 @@
import urllib
from tempest.common.rest_client import RestClient
+from tempest import config
+
+CONF = config.CONF
class FlavorsV3ClientJSON(RestClient):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(FlavorsV3ClientJSON, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(FlavorsV3ClientJSON, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.compute.catalog_v3_type
+ self.service = CONF.compute.catalog_v3_type
def list_flavors(self, params=None):
url = 'flavors'
diff --git a/tempest/services/compute/v3/json/hosts_client.py b/tempest/services/compute/v3/json/hosts_client.py
index 669bf59..d15b237 100644
--- a/tempest/services/compute/v3/json/hosts_client.py
+++ b/tempest/services/compute/v3/json/hosts_client.py
@@ -16,14 +16,17 @@
import urllib
from tempest.common.rest_client import RestClient
+from tempest import config
+
+CONF = config.CONF
class HostsV3ClientJSON(RestClient):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(HostsV3ClientJSON, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(HostsV3ClientJSON, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.compute.catalog_v3_type
+ self.service = CONF.compute.catalog_v3_type
def list_hosts(self, params=None):
"""Lists all hosts."""
diff --git a/tempest/services/compute/v3/json/hypervisor_client.py b/tempest/services/compute/v3/json/hypervisor_client.py
index d78cc5e..a4ec606 100644
--- a/tempest/services/compute/v3/json/hypervisor_client.py
+++ b/tempest/services/compute/v3/json/hypervisor_client.py
@@ -16,15 +16,18 @@
import json
from tempest.common.rest_client import RestClient
+from tempest import config
+
+CONF = config.CONF
class HypervisorV3ClientJSON(RestClient):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(HypervisorV3ClientJSON, self).__init__(config, username,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(HypervisorV3ClientJSON, self).__init__(username,
password, auth_url,
tenant_name)
- self.service = self.config.compute.catalog_v3_type
+ self.service = CONF.compute.catalog_v3_type
def get_hypervisor_list(self):
"""List hypervisors information."""
diff --git a/tempest/services/compute/v3/json/instance_usage_audit_log_client.py b/tempest/services/compute/v3/json/instance_usage_audit_log_client.py
index c5fba48..b51f490 100644
--- a/tempest/services/compute/v3/json/instance_usage_audit_log_client.py
+++ b/tempest/services/compute/v3/json/instance_usage_audit_log_client.py
@@ -16,14 +16,17 @@
import json
from tempest.common.rest_client import RestClient
+from tempest import config
+
+CONF = config.CONF
class InstanceUsagesAuditLogV3ClientJSON(RestClient):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
+ def __init__(self, username, password, auth_url, tenant_name=None):
super(InstanceUsagesAuditLogV3ClientJSON, self).__init__(
- config, username, password, auth_url, tenant_name)
- self.service = self.config.compute.catalog_v3_type
+ username, password, auth_url, tenant_name)
+ self.service = CONF.compute.catalog_v3_type
def list_instance_usage_audit_logs(self, time_before=None):
if time_before:
diff --git a/tempest/services/compute/v3/json/interfaces_client.py b/tempest/services/compute/v3/json/interfaces_client.py
index 7fb0fa9..8f0760c 100644
--- a/tempest/services/compute/v3/json/interfaces_client.py
+++ b/tempest/services/compute/v3/json/interfaces_client.py
@@ -17,16 +17,19 @@
import time
from tempest.common.rest_client import RestClient
+from tempest import config
from tempest import exceptions
+CONF = config.CONF
+
class InterfacesV3ClientJSON(RestClient):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(InterfacesV3ClientJSON, self).__init__(config, username,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(InterfacesV3ClientJSON, self).__init__(username,
password, auth_url,
tenant_name)
- self.service = self.config.compute.catalog_v3_type
+ self.service = CONF.compute.catalog_v3_type
def list_interfaces(self, server):
resp, body = self.get('servers/%s/os-attach-interfaces' % server)
diff --git a/tempest/services/compute/v3/json/keypairs_client.py b/tempest/services/compute/v3/json/keypairs_client.py
index 26018ae..c2efb84 100644
--- a/tempest/services/compute/v3/json/keypairs_client.py
+++ b/tempest/services/compute/v3/json/keypairs_client.py
@@ -16,14 +16,17 @@
import json
from tempest.common.rest_client import RestClient
+from tempest import config
+
+CONF = config.CONF
class KeyPairsV3ClientJSON(RestClient):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(KeyPairsV3ClientJSON, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(KeyPairsV3ClientJSON, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.compute.catalog_v3_type
+ self.service = CONF.compute.catalog_v3_type
def list_keypairs(self):
resp, body = self.get("keypairs")
diff --git a/tempest/services/compute/v3/json/quotas_client.py b/tempest/services/compute/v3/json/quotas_client.py
index 0f0fd00..ea0d3a2 100644
--- a/tempest/services/compute/v3/json/quotas_client.py
+++ b/tempest/services/compute/v3/json/quotas_client.py
@@ -16,14 +16,17 @@
import json
from tempest.common.rest_client import RestClient
+from tempest import config
+
+CONF = config.CONF
class QuotasV3ClientJSON(RestClient):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(QuotasV3ClientJSON, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(QuotasV3ClientJSON, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.compute.catalog_v3_type
+ self.service = CONF.compute.catalog_v3_type
def get_quota_set(self, tenant_id):
"""List the quota set for a tenant."""
diff --git a/tempest/services/compute/v3/json/servers_client.py b/tempest/services/compute/v3/json/servers_client.py
index ef282fa..aa8c95a 100644
--- a/tempest/services/compute/v3/json/servers_client.py
+++ b/tempest/services/compute/v3/json/servers_client.py
@@ -21,17 +21,20 @@
from tempest.common.rest_client import RestClient
from tempest.common import waiters
+from tempest import config
from tempest import exceptions
+CONF = config.CONF
+
class ServersV3ClientJSON(RestClient):
- def __init__(self, config, username, password, auth_url,
+ def __init__(self, username, password, auth_url,
tenant_name=None, auth_version='v2'):
- super(ServersV3ClientJSON, self).__init__(config, username, password,
+ super(ServersV3ClientJSON, self).__init__(username, password,
auth_url, tenant_name,
auth_version=auth_version)
- self.service = self.config.compute.catalog_v3_type
+ self.service = CONF.compute.catalog_v3_type
def create_server(self, name, image_ref, flavor_ref, **kwargs):
"""
diff --git a/tempest/services/compute/v3/json/services_client.py b/tempest/services/compute/v3/json/services_client.py
index e0c1c3c..174a4f7 100644
--- a/tempest/services/compute/v3/json/services_client.py
+++ b/tempest/services/compute/v3/json/services_client.py
@@ -18,14 +18,17 @@
import urllib
from tempest.common.rest_client import RestClient
+from tempest import config
+
+CONF = config.CONF
class ServicesV3ClientJSON(RestClient):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(ServicesV3ClientJSON, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(ServicesV3ClientJSON, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.compute.catalog_v3_type
+ self.service = CONF.compute.catalog_v3_type
def list_services(self, params=None):
url = 'os-services'
diff --git a/tempest/services/compute/v3/json/tenant_usages_client.py b/tempest/services/compute/v3/json/tenant_usages_client.py
index ff0251d..fbc41de 100644
--- a/tempest/services/compute/v3/json/tenant_usages_client.py
+++ b/tempest/services/compute/v3/json/tenant_usages_client.py
@@ -17,14 +17,17 @@
import urllib
from tempest.common.rest_client import RestClient
+from tempest import config
+
+CONF = config.CONF
class TenantUsagesV3ClientJSON(RestClient):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
+ def __init__(self, username, password, auth_url, tenant_name=None):
super(TenantUsagesV3ClientJSON, self).__init__(
- config, username, password, auth_url, tenant_name)
- self.service = self.config.compute.catalog_v3_type
+ username, password, auth_url, tenant_name)
+ self.service = CONF.compute.catalog_v3_type
def list_tenant_usages(self, params=None):
url = 'os-simple-tenant-usage'
diff --git a/tempest/services/compute/v3/json/version_client.py b/tempest/services/compute/v3/json/version_client.py
index 1773af5..419bbb8 100644
--- a/tempest/services/compute/v3/json/version_client.py
+++ b/tempest/services/compute/v3/json/version_client.py
@@ -16,15 +16,18 @@
import json
from tempest.common import rest_client
+from tempest import config
+
+CONF = config.CONF
class VersionV3ClientJSON(rest_client.RestClient):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(VersionV3ClientJSON, self).__init__(config, username,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(VersionV3ClientJSON, self).__init__(username,
password, auth_url,
tenant_name)
- self.service = self.config.compute.catalog_v3_type
+ self.service = CONF.compute.catalog_v3_type
def get_version(self):
resp, body = self.get('')
diff --git a/tempest/services/compute/xml/aggregates_client.py b/tempest/services/compute/xml/aggregates_client.py
index 164a963..ddef18b 100644
--- a/tempest/services/compute/xml/aggregates_client.py
+++ b/tempest/services/compute/xml/aggregates_client.py
@@ -16,19 +16,22 @@
from lxml import etree
from tempest.common.rest_client import RestClientXML
+from tempest import config
from tempest import exceptions
from tempest.services.compute.xml.common import Document
from tempest.services.compute.xml.common import Element
from tempest.services.compute.xml.common import Text
from tempest.services.compute.xml.common import xml_to_json
+CONF = config.CONF
+
class AggregatesClientXML(RestClientXML):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(AggregatesClientXML, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(AggregatesClientXML, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.compute.catalog_type
+ self.service = CONF.compute.catalog_type
def _format_aggregate(self, g):
agg = xml_to_json(g)
diff --git a/tempest/services/compute/xml/availability_zone_client.py b/tempest/services/compute/xml/availability_zone_client.py
index 4024d29..ac1bb4b 100644
--- a/tempest/services/compute/xml/availability_zone_client.py
+++ b/tempest/services/compute/xml/availability_zone_client.py
@@ -16,16 +16,19 @@
from lxml import etree
from tempest.common.rest_client import RestClientXML
+from tempest import config
from tempest.services.compute.xml.common import xml_to_json
+CONF = config.CONF
+
class AvailabilityZoneClientXML(RestClientXML):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(AvailabilityZoneClientXML, self).__init__(config, username,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(AvailabilityZoneClientXML, self).__init__(username,
password, auth_url,
tenant_name)
- self.service = self.config.compute.catalog_type
+ self.service = CONF.compute.catalog_type
def _parse_array(self, node):
return [xml_to_json(x) for x in node]
diff --git a/tempest/services/compute/xml/certificates_client.py b/tempest/services/compute/xml/certificates_client.py
index 682f8de..3f2438d 100644
--- a/tempest/services/compute/xml/certificates_client.py
+++ b/tempest/services/compute/xml/certificates_client.py
@@ -15,14 +15,17 @@
from tempest.common.rest_client import RestClientXML
+from tempest import config
+
+CONF = config.CONF
class CertificatesClientXML(RestClientXML):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(CertificatesClientXML, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(CertificatesClientXML, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.compute.catalog_type
+ self.service = CONF.compute.catalog_type
def get_certificate(self, id):
url = "os-certificates/%s" % (id)
diff --git a/tempest/services/compute/xml/extensions_client.py b/tempest/services/compute/xml/extensions_client.py
index b2ab9da..98cd3e3 100644
--- a/tempest/services/compute/xml/extensions_client.py
+++ b/tempest/services/compute/xml/extensions_client.py
@@ -14,16 +14,20 @@
# under the License.
from lxml import etree
+
from tempest.common.rest_client import RestClientXML
+from tempest import config
from tempest.services.compute.xml.common import xml_to_json
+CONF = config.CONF
+
class ExtensionsClientXML(RestClientXML):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(ExtensionsClientXML, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(ExtensionsClientXML, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.compute.catalog_type
+ self.service = CONF.compute.catalog_type
def _parse_array(self, node):
array = []
diff --git a/tempest/services/compute/xml/fixed_ips_client.py b/tempest/services/compute/xml/fixed_ips_client.py
index 53482c1..f212e21 100644
--- a/tempest/services/compute/xml/fixed_ips_client.py
+++ b/tempest/services/compute/xml/fixed_ips_client.py
@@ -15,17 +15,20 @@
from tempest.common.rest_client import RestClientXML
+from tempest import config
from tempest.services.compute.xml.common import Document
from tempest.services.compute.xml.common import Element
from tempest.services.compute.xml.common import Text
+CONF = config.CONF
+
class FixedIPsClientXML(RestClientXML):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(FixedIPsClientXML, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(FixedIPsClientXML, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.compute.catalog_type
+ self.service = CONF.compute.catalog_type
def get_fixed_ip_details(self, fixed_ip):
url = "os-fixed-ips/%s" % (fixed_ip)
diff --git a/tempest/services/compute/xml/flavors_client.py b/tempest/services/compute/xml/flavors_client.py
index b7e63e6..74c0e47 100644
--- a/tempest/services/compute/xml/flavors_client.py
+++ b/tempest/services/compute/xml/flavors_client.py
@@ -18,12 +18,14 @@
from lxml import etree
from tempest.common.rest_client import RestClientXML
+from tempest import config
from tempest.services.compute.xml.common import Document
from tempest.services.compute.xml.common import Element
from tempest.services.compute.xml.common import Text
from tempest.services.compute.xml.common import xml_to_json
from tempest.services.compute.xml.common import XMLNS_11
+CONF = config.CONF
XMLNS_OS_FLV_EXT_DATA = \
"http://docs.openstack.org/compute/ext/flavor_extra_data/api/v1.1"
@@ -33,10 +35,10 @@
class FlavorsClientXML(RestClientXML):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(FlavorsClientXML, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(FlavorsClientXML, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.compute.catalog_type
+ self.service = CONF.compute.catalog_type
def _format_flavor(self, f):
flavor = {'links': []}
diff --git a/tempest/services/compute/xml/floating_ips_client.py b/tempest/services/compute/xml/floating_ips_client.py
index de78b1e..bbfe86b 100644
--- a/tempest/services/compute/xml/floating_ips_client.py
+++ b/tempest/services/compute/xml/floating_ips_client.py
@@ -17,18 +17,21 @@
import urllib
from tempest.common.rest_client import RestClientXML
+from tempest import config
from tempest import exceptions
from tempest.services.compute.xml.common import Document
from tempest.services.compute.xml.common import Element
from tempest.services.compute.xml.common import Text
from tempest.services.compute.xml.common import xml_to_json
+CONF = config.CONF
+
class FloatingIPsClientXML(RestClientXML):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(FloatingIPsClientXML, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(FloatingIPsClientXML, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.compute.catalog_type
+ self.service = CONF.compute.catalog_type
def _parse_array(self, node):
array = []
diff --git a/tempest/services/compute/xml/hosts_client.py b/tempest/services/compute/xml/hosts_client.py
index e7931a3..441be0e 100644
--- a/tempest/services/compute/xml/hosts_client.py
+++ b/tempest/services/compute/xml/hosts_client.py
@@ -16,17 +16,20 @@
from lxml import etree
from tempest.common.rest_client import RestClientXML
+from tempest import config
from tempest.services.compute.xml.common import Document
from tempest.services.compute.xml.common import Element
from tempest.services.compute.xml.common import xml_to_json
+CONF = config.CONF
+
class HostsClientXML(RestClientXML):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(HostsClientXML, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(HostsClientXML, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.compute.catalog_type
+ self.service = CONF.compute.catalog_type
def list_hosts(self, params=None):
"""Lists all hosts."""
diff --git a/tempest/services/compute/xml/hypervisor_client.py b/tempest/services/compute/xml/hypervisor_client.py
index e988a36..bee2dfd 100644
--- a/tempest/services/compute/xml/hypervisor_client.py
+++ b/tempest/services/compute/xml/hypervisor_client.py
@@ -16,16 +16,19 @@
from lxml import etree
from tempest.common.rest_client import RestClientXML
+from tempest import config
from tempest.services.compute.xml.common import xml_to_json
+CONF = config.CONF
+
class HypervisorClientXML(RestClientXML):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(HypervisorClientXML, self).__init__(config, username,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(HypervisorClientXML, self).__init__(username,
password, auth_url,
tenant_name)
- self.service = self.config.compute.catalog_type
+ self.service = CONF.compute.catalog_type
def _parse_array(self, node):
return [xml_to_json(x) for x in node]
diff --git a/tempest/services/compute/xml/images_client.py b/tempest/services/compute/xml/images_client.py
index 6c5a14c..98de7df 100644
--- a/tempest/services/compute/xml/images_client.py
+++ b/tempest/services/compute/xml/images_client.py
@@ -19,6 +19,7 @@
from tempest.common.rest_client import RestClientXML
from tempest.common import waiters
+from tempest import config
from tempest import exceptions
from tempest.services.compute.xml.common import Document
from tempest.services.compute.xml.common import Element
@@ -26,15 +27,17 @@
from tempest.services.compute.xml.common import xml_to_json
from tempest.services.compute.xml.common import XMLNS_11
+CONF = config.CONF
+
class ImagesClientXML(RestClientXML):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(ImagesClientXML, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(ImagesClientXML, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.compute.catalog_type
- self.build_interval = self.config.compute.build_interval
- self.build_timeout = self.config.compute.build_timeout
+ self.service = CONF.compute.catalog_type
+ self.build_interval = CONF.compute.build_interval
+ self.build_timeout = CONF.compute.build_timeout
def _parse_server(self, node):
data = xml_to_json(node)
diff --git a/tempest/services/compute/xml/instance_usage_audit_log_client.py b/tempest/services/compute/xml/instance_usage_audit_log_client.py
index 473ecd1..2e1d6c8 100644
--- a/tempest/services/compute/xml/instance_usage_audit_log_client.py
+++ b/tempest/services/compute/xml/instance_usage_audit_log_client.py
@@ -16,15 +16,18 @@
from lxml import etree
from tempest.common.rest_client import RestClientXML
+from tempest import config
from tempest.services.compute.xml.common import xml_to_json
+CONF = config.CONF
+
class InstanceUsagesAuditLogClientXML(RestClientXML):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
+ def __init__(self, username, password, auth_url, tenant_name=None):
super(InstanceUsagesAuditLogClientXML, self).__init__(
- config, username, password, auth_url, tenant_name)
- self.service = self.config.compute.catalog_type
+ username, password, auth_url, tenant_name)
+ self.service = CONF.compute.catalog_type
def list_instance_usage_audit_logs(self):
url = 'os-instance_usage_audit_log'
diff --git a/tempest/services/compute/xml/interfaces_client.py b/tempest/services/compute/xml/interfaces_client.py
index a84e0bd..c90f507 100644
--- a/tempest/services/compute/xml/interfaces_client.py
+++ b/tempest/services/compute/xml/interfaces_client.py
@@ -18,19 +18,22 @@
from lxml import etree
from tempest.common.rest_client import RestClientXML
+from tempest import config
from tempest import exceptions
from tempest.services.compute.xml.common import Document
from tempest.services.compute.xml.common import Element
from tempest.services.compute.xml.common import Text
from tempest.services.compute.xml.common import xml_to_json
+CONF = config.CONF
+
class InterfacesClientXML(RestClientXML):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(InterfacesClientXML, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(InterfacesClientXML, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.compute.catalog_type
+ self.service = CONF.compute.catalog_type
def _process_xml_interface(self, node):
iface = xml_to_json(node)
diff --git a/tempest/services/compute/xml/keypairs_client.py b/tempest/services/compute/xml/keypairs_client.py
index 57c4dda..da3303e 100644
--- a/tempest/services/compute/xml/keypairs_client.py
+++ b/tempest/services/compute/xml/keypairs_client.py
@@ -15,19 +15,23 @@
from lxml import etree
+
from tempest.common.rest_client import RestClientXML
+from tempest import config
from tempest.services.compute.xml.common import Document
from tempest.services.compute.xml.common import Element
from tempest.services.compute.xml.common import Text
from tempest.services.compute.xml.common import xml_to_json
+CONF = config.CONF
+
class KeyPairsClientXML(RestClientXML):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(KeyPairsClientXML, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(KeyPairsClientXML, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.compute.catalog_type
+ self.service = CONF.compute.catalog_type
def list_keypairs(self):
resp, body = self.get("os-keypairs", self.headers)
diff --git a/tempest/services/compute/xml/limits_client.py b/tempest/services/compute/xml/limits_client.py
index 785d546..9233697 100644
--- a/tempest/services/compute/xml/limits_client.py
+++ b/tempest/services/compute/xml/limits_client.py
@@ -16,16 +16,19 @@
from lxml import objectify
from tempest.common.rest_client import RestClientXML
+from tempest import config
+
+CONF = config.CONF
NS = "{http://docs.openstack.org/common/api/v1.0}"
class LimitsClientXML(RestClientXML):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(LimitsClientXML, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(LimitsClientXML, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.compute.catalog_type
+ self.service = CONF.compute.catalog_type
def get_absolute_limits(self):
resp, body = self.get("limits", self.headers)
diff --git a/tempest/services/compute/xml/quotas_client.py b/tempest/services/compute/xml/quotas_client.py
index f157dfb..74aad1b 100644
--- a/tempest/services/compute/xml/quotas_client.py
+++ b/tempest/services/compute/xml/quotas_client.py
@@ -16,18 +16,21 @@
from lxml import etree
from tempest.common.rest_client import RestClientXML
+from tempest import config
from tempest.services.compute.xml.common import Document
from tempest.services.compute.xml.common import Element
from tempest.services.compute.xml.common import xml_to_json
from tempest.services.compute.xml.common import XMLNS_11
+CONF = config.CONF
+
class QuotasClientXML(RestClientXML):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(QuotasClientXML, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(QuotasClientXML, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.compute.catalog_type
+ self.service = CONF.compute.catalog_type
def _format_quota(self, q):
quota = {}
diff --git a/tempest/services/compute/xml/security_groups_client.py b/tempest/services/compute/xml/security_groups_client.py
index 498922b..c32a81e 100644
--- a/tempest/services/compute/xml/security_groups_client.py
+++ b/tempest/services/compute/xml/security_groups_client.py
@@ -17,6 +17,7 @@
import urllib
from tempest.common.rest_client import RestClientXML
+from tempest import config
from tempest import exceptions
from tempest.services.compute.xml.common import Document
from tempest.services.compute.xml.common import Element
@@ -24,14 +25,16 @@
from tempest.services.compute.xml.common import xml_to_json
from tempest.services.compute.xml.common import XMLNS_11
+CONF = config.CONF
+
class SecurityGroupsClientXML(RestClientXML):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
+ def __init__(self, username, password, auth_url, tenant_name=None):
super(SecurityGroupsClientXML, self).__init__(
- config, username, password,
+ username, password,
auth_url, tenant_name)
- self.service = self.config.compute.catalog_type
+ self.service = CONF.compute.catalog_type
def _parse_array(self, node):
array = []
diff --git a/tempest/services/compute/xml/servers_client.py b/tempest/services/compute/xml/servers_client.py
index 63492b7..68268a1 100644
--- a/tempest/services/compute/xml/servers_client.py
+++ b/tempest/services/compute/xml/servers_client.py
@@ -21,6 +21,7 @@
from tempest.common.rest_client import RestClientXML
from tempest.common import waiters
+from tempest import config
from tempest import exceptions
from tempest.openstack.common import log as logging
from tempest.services.compute.xml.common import Document
@@ -29,6 +30,7 @@
from tempest.services.compute.xml.common import xml_to_json
from tempest.services.compute.xml.common import XMLNS_11
+CONF = config.CONF
LOG = logging.getLogger(__name__)
@@ -139,12 +141,12 @@
class ServersClientXML(RestClientXML):
- def __init__(self, config, username, password, auth_url, tenant_name=None,
+ def __init__(self, username, password, auth_url, tenant_name=None,
auth_version='v2'):
- super(ServersClientXML, self).__init__(config, username, password,
+ super(ServersClientXML, self).__init__(username, password,
auth_url, tenant_name,
auth_version=auth_version)
- self.service = self.config.compute.catalog_type
+ self.service = CONF.compute.catalog_type
def _parse_key_value(self, node):
"""Parse <foo key='key'>value</foo> data into {'key': 'value'}."""
diff --git a/tempest/services/compute/xml/services_client.py b/tempest/services/compute/xml/services_client.py
index 8ef0aa8..bfc824d 100644
--- a/tempest/services/compute/xml/services_client.py
+++ b/tempest/services/compute/xml/services_client.py
@@ -17,18 +17,22 @@
import urllib
from lxml import etree
+
from tempest.common.rest_client import RestClientXML
+from tempest import config
from tempest.services.compute.xml.common import Document
from tempest.services.compute.xml.common import Element
from tempest.services.compute.xml.common import xml_to_json
+CONF = config.CONF
+
class ServicesClientXML(RestClientXML):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(ServicesClientXML, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(ServicesClientXML, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.compute.catalog_type
+ self.service = CONF.compute.catalog_type
def list_services(self, params=None):
url = 'os-services'
diff --git a/tempest/services/compute/xml/tenant_usages_client.py b/tempest/services/compute/xml/tenant_usages_client.py
index dfa4a9f..ae813a6 100644
--- a/tempest/services/compute/xml/tenant_usages_client.py
+++ b/tempest/services/compute/xml/tenant_usages_client.py
@@ -18,16 +18,19 @@
from lxml import etree
from tempest.common.rest_client import RestClientXML
+from tempest import config
from tempest.services.compute.xml.common import xml_to_json
+CONF = config.CONF
+
class TenantUsagesClientXML(RestClientXML):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(TenantUsagesClientXML, self).__init__(config, username,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(TenantUsagesClientXML, self).__init__(username,
password, auth_url,
tenant_name)
- self.service = self.config.compute.catalog_type
+ self.service = CONF.compute.catalog_type
def _parse_array(self, node):
json = xml_to_json(node)
diff --git a/tempest/services/compute/xml/volumes_extensions_client.py b/tempest/services/compute/xml/volumes_extensions_client.py
index cb6cefc..d6723e1 100644
--- a/tempest/services/compute/xml/volumes_extensions_client.py
+++ b/tempest/services/compute/xml/volumes_extensions_client.py
@@ -19,6 +19,7 @@
from lxml import etree
from tempest.common.rest_client import RestClientXML
+from tempest import config
from tempest import exceptions
from tempest.services.compute.xml.common import Document
from tempest.services.compute.xml.common import Element
@@ -26,16 +27,17 @@
from tempest.services.compute.xml.common import xml_to_json
from tempest.services.compute.xml.common import XMLNS_11
+CONF = config.CONF
+
class VolumesExtensionsClientXML(RestClientXML):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(VolumesExtensionsClientXML, self).__init__(config,
- username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(VolumesExtensionsClientXML, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.compute.catalog_type
- self.build_interval = self.config.compute.build_interval
- self.build_timeout = self.config.compute.build_timeout
+ self.service = CONF.compute.catalog_type
+ self.build_interval = CONF.compute.build_interval
+ self.build_timeout = CONF.compute.build_timeout
def _parse_volume(self, body):
vol = dict((attr, body.get(attr)) for attr in body.keys())
diff --git a/tempest/services/data_processing/v1_1/client.py b/tempest/services/data_processing/v1_1/client.py
index bd147e8..a1d558a 100644
--- a/tempest/services/data_processing/v1_1/client.py
+++ b/tempest/services/data_processing/v1_1/client.py
@@ -16,13 +16,16 @@
import json
from tempest.common import rest_client
+from tempest import config
+
+CONF = config.CONF
class DataProcessingClient(rest_client.RestClient):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(DataProcessingClient, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(DataProcessingClient, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.data_processing.catalog_type
+ self.service = CONF.data_processing.catalog_type
@classmethod
def _request_and_parse(cls, req_fun, uri, res_name, *args, **kwargs):
diff --git a/tempest/services/identity/json/identity_client.py b/tempest/services/identity/json/identity_client.py
index a0411dc..1ed7044 100644
--- a/tempest/services/identity/json/identity_client.py
+++ b/tempest/services/identity/json/identity_client.py
@@ -14,15 +14,18 @@
from tempest.common import http
from tempest.common.rest_client import RestClient
+from tempest import config
from tempest import exceptions
+CONF = config.CONF
+
class IdentityClientJSON(RestClient):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(IdentityClientJSON, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(IdentityClientJSON, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.identity.catalog_type
+ self.service = CONF.identity.catalog_type
self.endpoint_url = 'adminURL'
def has_admin_extensions(self):
@@ -239,8 +242,8 @@
class TokenClientJSON(RestClient):
- def __init__(self, config):
- auth_url = config.identity.uri
+ def __init__(self):
+ auth_url = CONF.identity.uri
# TODO(jaypipes) Why is this all repeated code in here?
# Normalize URI to ensure /tokens is in it.
@@ -248,7 +251,6 @@
auth_url = auth_url.rstrip('/') + '/tokens'
self.auth_url = auth_url
- self.config = config
def auth(self, user, password, tenant):
creds = {
@@ -267,7 +269,7 @@
def request(self, method, url, headers=None, body=None):
"""A simple HTTP request interface."""
- dscv = self.config.identity.disable_ssl_certificate_validation
+ dscv = CONF.identity.disable_ssl_certificate_validation
self.http_obj = http.ClosingHttp(
disable_ssl_certificate_validation=dscv)
if headers is None:
diff --git a/tempest/services/identity/v3/json/credentials_client.py b/tempest/services/identity/v3/json/credentials_client.py
index dccb9a0..1250d79 100644
--- a/tempest/services/identity/v3/json/credentials_client.py
+++ b/tempest/services/identity/v3/json/credentials_client.py
@@ -17,14 +17,17 @@
from urlparse import urlparse
from tempest.common.rest_client import RestClient
+from tempest import config
+
+CONF = config.CONF
class CredentialsClientJSON(RestClient):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(CredentialsClientJSON, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(CredentialsClientJSON, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.identity.catalog_type
+ self.service = CONF.identity.catalog_type
self.endpoint_url = 'adminURL'
def request(self, method, url, headers=None, body=None, wait=None):
diff --git a/tempest/services/identity/v3/json/endpoints_client.py b/tempest/services/identity/v3/json/endpoints_client.py
index 124f498..bb2230b 100644
--- a/tempest/services/identity/v3/json/endpoints_client.py
+++ b/tempest/services/identity/v3/json/endpoints_client.py
@@ -17,15 +17,17 @@
import urlparse
from tempest.common.rest_client import RestClient
+from tempest import config
+
+CONF = config.CONF
class EndPointClientJSON(RestClient):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(EndPointClientJSON, self).__init__(config,
- username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(EndPointClientJSON, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.identity.catalog_type
+ self.service = CONF.identity.catalog_type
self.endpoint_url = 'adminURL'
def request(self, method, url, headers=None, body=None, wait=None):
diff --git a/tempest/services/identity/v3/json/identity_client.py b/tempest/services/identity/v3/json/identity_client.py
index c89fbcc..7dd5c6e 100644
--- a/tempest/services/identity/v3/json/identity_client.py
+++ b/tempest/services/identity/v3/json/identity_client.py
@@ -17,14 +17,17 @@
from urlparse import urlparse
from tempest.common.rest_client import RestClient
+from tempest import config
+
+CONF = config.CONF
class IdentityV3ClientJSON(RestClient):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(IdentityV3ClientJSON, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(IdentityV3ClientJSON, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.identity.catalog_type
+ self.service = CONF.identity.catalog_type
self.endpoint_url = 'adminURL'
def request(self, method, url, headers=None, body=None, wait=None):
@@ -459,19 +462,18 @@
class V3TokenClientJSON(RestClient):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(V3TokenClientJSON, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(V3TokenClientJSON, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.identity.catalog_type
+ self.service = CONF.identity.catalog_type
self.endpoint_url = 'adminURL'
- auth_url = config.identity.uri
+ auth_url = CONF.identity.uri
if 'tokens' not in auth_url:
auth_url = auth_url.rstrip('/') + '/tokens'
self.auth_url = auth_url
- self.config = config
def auth(self, user_id, password):
creds = {
diff --git a/tempest/services/identity/v3/json/policy_client.py b/tempest/services/identity/v3/json/policy_client.py
index 9ce6d5b..3d98d99 100644
--- a/tempest/services/identity/v3/json/policy_client.py
+++ b/tempest/services/identity/v3/json/policy_client.py
@@ -17,14 +17,17 @@
from urlparse import urlparse
from tempest.common.rest_client import RestClient
+from tempest import config
+
+CONF = config.CONF
class PolicyClientJSON(RestClient):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(PolicyClientJSON, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(PolicyClientJSON, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.identity.catalog_type
+ self.service = CONF.identity.catalog_type
self.endpoint_url = 'adminURL'
def request(self, method, url, headers=None, body=None, wait=None):
diff --git a/tempest/services/identity/v3/json/service_client.py b/tempest/services/identity/v3/json/service_client.py
index e60e7e3..57b6e9e 100644
--- a/tempest/services/identity/v3/json/service_client.py
+++ b/tempest/services/identity/v3/json/service_client.py
@@ -17,14 +17,17 @@
from urlparse import urlparse
from tempest.common.rest_client import RestClient
+from tempest import config
+
+CONF = config.CONF
class ServiceClientJSON(RestClient):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(ServiceClientJSON, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(ServiceClientJSON, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.identity.catalog_type
+ self.service = CONF.identity.catalog_type
self.endpoint_url = 'adminURL'
def request(self, method, url, headers=None, body=None, wait=None):
diff --git a/tempest/services/identity/v3/xml/credentials_client.py b/tempest/services/identity/v3/xml/credentials_client.py
index 4344db1..c8cdce7 100644
--- a/tempest/services/identity/v3/xml/credentials_client.py
+++ b/tempest/services/identity/v3/xml/credentials_client.py
@@ -19,21 +19,23 @@
from lxml import etree
from tempest.common.rest_client import RestClientXML
+from tempest import config
from tempest.services.compute.xml.common import Document
from tempest.services.compute.xml.common import Element
from tempest.services.compute.xml.common import Text
from tempest.services.compute.xml.common import xml_to_json
+CONF = config.CONF
XMLNS = "http://docs.openstack.org/identity/api/v3"
class CredentialsClientXML(RestClientXML):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(CredentialsClientXML, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(CredentialsClientXML, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.identity.catalog_type
+ self.service = CONF.identity.catalog_type
self.endpoint_url = 'adminURL'
def request(self, method, url, headers=None, body=None, wait=None):
diff --git a/tempest/services/identity/v3/xml/endpoints_client.py b/tempest/services/identity/v3/xml/endpoints_client.py
index bd23674..e1df3a9 100644
--- a/tempest/services/identity/v3/xml/endpoints_client.py
+++ b/tempest/services/identity/v3/xml/endpoints_client.py
@@ -18,19 +18,22 @@
from tempest.common import http
from tempest.common.rest_client import RestClientXML
+from tempest import config
from tempest.services.compute.xml.common import Document
from tempest.services.compute.xml.common import Element
from tempest.services.compute.xml.common import xml_to_json
+CONF = config.CONF
+
XMLNS = "http://docs.openstack.org/identity/api/v3"
class EndPointClientXML(RestClientXML):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(EndPointClientXML, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(EndPointClientXML, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.identity.catalog_type
+ self.service = CONF.identity.catalog_type
self.endpoint_url = 'adminURL'
def _parse_array(self, node):
@@ -47,7 +50,7 @@
def request(self, method, url, headers=None, body=None, wait=None):
"""Overriding the existing HTTP request in super class RestClient."""
- dscv = self.config.identity.disable_ssl_certificate_validation
+ dscv = CONF.identity.disable_ssl_certificate_validation
self.http_obj = http.ClosingHttp(
disable_ssl_certificate_validation=dscv)
self._set_auth()
diff --git a/tempest/services/identity/v3/xml/identity_client.py b/tempest/services/identity/v3/xml/identity_client.py
index 579ddb8..de75fe5 100644
--- a/tempest/services/identity/v3/xml/identity_client.py
+++ b/tempest/services/identity/v3/xml/identity_client.py
@@ -18,20 +18,23 @@
from lxml import etree
from tempest.common.rest_client import RestClientXML
+from tempest import config
from tempest.services.compute.xml.common import Document
from tempest.services.compute.xml.common import Element
from tempest.services.compute.xml.common import Text
from tempest.services.compute.xml.common import xml_to_json
+CONF = config.CONF
+
XMLNS = "http://docs.openstack.org/identity/api/v3"
class IdentityV3ClientXML(RestClientXML):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(IdentityV3ClientXML, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(IdentityV3ClientXML, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.identity.catalog_type
+ self.service = CONF.identity.catalog_type
self.endpoint_url = 'adminURL'
def _parse_projects(self, node):
@@ -451,19 +454,18 @@
class V3TokenClientXML(RestClientXML):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(V3TokenClientXML, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(V3TokenClientXML, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.identity.catalog_type
+ self.service = CONF.identity.catalog_type
self.endpoint_url = 'adminURL'
- auth_url = config.identity.uri
+ auth_url = CONF.identity.uri
if 'tokens' not in auth_url:
auth_url = auth_url.rstrip('/') + '/tokens'
self.auth_url = auth_url
- self.config = config
def auth(self, user_id, password):
user = Element('user',
diff --git a/tempest/services/identity/v3/xml/policy_client.py b/tempest/services/identity/v3/xml/policy_client.py
index 7317728..54b4ad8 100644
--- a/tempest/services/identity/v3/xml/policy_client.py
+++ b/tempest/services/identity/v3/xml/policy_client.py
@@ -19,19 +19,22 @@
from tempest.common import http
from tempest.common.rest_client import RestClientXML
+from tempest import config
from tempest.services.compute.xml.common import Document
from tempest.services.compute.xml.common import Element
from tempest.services.compute.xml.common import xml_to_json
+CONF = config.CONF
+
XMLNS = "http://docs.openstack.org/identity/api/v3"
class PolicyClientXML(RestClientXML):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(PolicyClientXML, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(PolicyClientXML, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.identity.catalog_type
+ self.service = CONF.identity.catalog_type
self.endpoint_url = 'adminURL'
def _parse_array(self, node):
@@ -48,7 +51,7 @@
def request(self, method, url, headers=None, body=None, wait=None):
"""Overriding the existing HTTP request in super class RestClient."""
- dscv = self.config.identity.disable_ssl_certificate_validation
+ dscv = CONF.identity.disable_ssl_certificate_validation
self.http_obj = http.ClosingHttp(
disable_ssl_certificate_validation=dscv)
self._set_auth()
diff --git a/tempest/services/identity/v3/xml/service_client.py b/tempest/services/identity/v3/xml/service_client.py
index a142b06..2997775 100644
--- a/tempest/services/identity/v3/xml/service_client.py
+++ b/tempest/services/identity/v3/xml/service_client.py
@@ -18,20 +18,22 @@
from lxml import etree
from tempest.common.rest_client import RestClientXML
+from tempest import config
from tempest.services.compute.xml.common import Document
from tempest.services.compute.xml.common import Element
from tempest.services.compute.xml.common import xml_to_json
+CONF = config.CONF
XMLNS = "http://docs.openstack.org/identity/api/v3"
class ServiceClientXML(RestClientXML):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(ServiceClientXML, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(ServiceClientXML, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.identity.catalog_type
+ self.service = CONF.identity.catalog_type
self.endpoint_url = 'adminURL'
def _parse_array(self, node):
diff --git a/tempest/services/identity/xml/identity_client.py b/tempest/services/identity/xml/identity_client.py
index 6e819d8..e6a7188 100644
--- a/tempest/services/identity/xml/identity_client.py
+++ b/tempest/services/identity/xml/identity_client.py
@@ -19,21 +19,23 @@
from tempest.common import http
from tempest.common.rest_client import RestClientXML
+from tempest import config
from tempest import exceptions
from tempest.services.compute.xml.common import Document
from tempest.services.compute.xml.common import Element
from tempest.services.compute.xml.common import xml_to_json
+CONF = config.CONF
XMLNS = "http://docs.openstack.org/identity/api/v2.0"
class IdentityClientXML(RestClientXML):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(IdentityClientXML, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(IdentityClientXML, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.identity.catalog_type
+ self.service = CONF.identity.catalog_type
self.endpoint_url = 'adminURL'
def _parse_array(self, node):
@@ -263,8 +265,8 @@
class TokenClientXML(RestClientXML):
- def __init__(self, config):
- auth_url = config.identity.uri
+ def __init__(self):
+ auth_url = CONF.identity.uri
# TODO(jaypipes) Why is this all repeated code in here?
# Normalize URI to ensure /tokens is in it.
@@ -272,7 +274,6 @@
auth_url = auth_url.rstrip('/') + '/tokens'
self.auth_url = auth_url
- self.config = config
def auth(self, user, password, tenant):
passwordCreds = Element("passwordCredentials",
@@ -287,7 +288,7 @@
def request(self, method, url, headers=None, body=None):
"""A simple HTTP request interface."""
- dscv = self.config.identity.disable_ssl_certificate_validation
+ dscv = CONF.identity.disable_ssl_certificate_validation
self.http_obj = http.ClosingHttp(
disable_ssl_certificate_validation=dscv)
if headers is None:
diff --git a/tempest/services/image/v1/json/image_client.py b/tempest/services/image/v1/json/image_client.py
index aa6abd0..a5b93a0 100644
--- a/tempest/services/image/v1/json/image_client.py
+++ b/tempest/services/image/v1/json/image_client.py
@@ -22,19 +22,22 @@
from tempest.common import glance_http
from tempest.common.rest_client import RestClient
+from tempest import config
from tempest import exceptions
from tempest.openstack.common import log as logging
+CONF = config.CONF
+
LOG = logging.getLogger(__name__)
class ImageClientJSON(RestClient):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(ImageClientJSON, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(ImageClientJSON, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.images.catalog_type
- if config.service_available.glance:
+ self.service = CONF.images.catalog_type
+ if CONF.service_available.glance:
self.http = self._get_http()
def _image_meta_from_headers(self, headers):
@@ -108,7 +111,7 @@
self.auth_url,
self.service,
self.tenant_name)
- dscv = self.config.identity.disable_ssl_certificate_validation
+ dscv = CONF.identity.disable_ssl_certificate_validation
return glance_http.HTTPClient(endpoint=endpoint, token=token,
insecure=dscv)
diff --git a/tempest/services/image/v2/json/image_client.py b/tempest/services/image/v2/json/image_client.py
index 3a79695..0c4fb5c 100644
--- a/tempest/services/image/v2/json/image_client.py
+++ b/tempest/services/image/v2/json/image_client.py
@@ -20,23 +20,26 @@
from tempest.common import glance_http
from tempest.common import rest_client
+from tempest import config
from tempest import exceptions
+CONF = config.CONF
+
class ImageClientV2JSON(rest_client.RestClient):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(ImageClientV2JSON, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(ImageClientV2JSON, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.images.catalog_type
- if config.service_available.glance:
+ self.service = CONF.images.catalog_type
+ if CONF.service_available.glance:
self.http = self._get_http()
def _get_http(self):
token, endpoint = self.keystone_auth(self.user, self.password,
self.auth_url, self.service,
self.tenant_name)
- dscv = self.config.identity.disable_ssl_certificate_validation
+ dscv = CONF.identity.disable_ssl_certificate_validation
return glance_http.HTTPClient(endpoint=endpoint, token=token,
insecure=dscv)
diff --git a/tempest/services/network/json/network_client.py b/tempest/services/network/json/network_client.py
index 47c20d2..9908816 100644
--- a/tempest/services/network/json/network_client.py
+++ b/tempest/services/network/json/network_client.py
@@ -31,9 +31,9 @@
quotas
"""
- def get_rest_client(self, config, username,
+ def get_rest_client(self, username,
password, auth_url, tenant_name=None):
- return RestClient(config, username, password, auth_url, tenant_name)
+ return RestClient(username, password, auth_url, tenant_name)
def deserialize_single(self, body):
return json.loads(body)
diff --git a/tempest/services/network/network_client_base.py b/tempest/services/network/network_client_base.py
index f4a012f..467256e 100644
--- a/tempest/services/network/network_client_base.py
+++ b/tempest/services/network/network_client_base.py
@@ -12,6 +12,10 @@
import urllib
+from tempest import config
+
+CONF = config.CONF
+
# the following map is used to construct proper URI
# for the given neutron resource
service_resource_prefix_map = {
@@ -42,15 +46,15 @@
class NetworkClientBase(object):
- def __init__(self, config, username, password,
+ def __init__(self, username, password,
auth_url, tenant_name=None):
self.rest_client = self.get_rest_client(
- config, username, password, auth_url, tenant_name)
- self.rest_client.service = self.rest_client.config.network.catalog_type
+ username, password, auth_url, tenant_name)
+ self.rest_client.service = CONF.network.catalog_type
self.version = '2.0'
self.uri_prefix = "v%s" % (self.version)
- def get_rest_client(self, config, username, password,
+ def get_rest_client(self, username, password,
auth_url, tenant_name):
raise NotImplementedError
diff --git a/tempest/services/network/xml/network_client.py b/tempest/services/network/xml/network_client.py
index b8e39ad..4eb38be 100644
--- a/tempest/services/network/xml/network_client.py
+++ b/tempest/services/network/xml/network_client.py
@@ -28,9 +28,9 @@
PLURALS = ['dns_nameservers', 'host_routes', 'allocation_pools',
'fixed_ips', 'extensions']
- def get_rest_client(self, config, username, password,
+ def get_rest_client(self, username, password,
auth_url, tenant_name=None):
- return RestClientXML(config, username, password,
+ return RestClientXML(username, password,
auth_url, tenant_name)
def _parse_array(self, node):
diff --git a/tempest/services/object_storage/account_client.py b/tempest/services/object_storage/account_client.py
index a6f47b7..4c5b832 100644
--- a/tempest/services/object_storage/account_client.py
+++ b/tempest/services/object_storage/account_client.py
@@ -18,14 +18,17 @@
from tempest.common import http
from tempest.common.rest_client import RestClient
+from tempest import config
from tempest import exceptions
+CONF = config.CONF
+
class AccountClient(RestClient):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(AccountClient, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(AccountClient, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.object_storage.catalog_type
+ self.service = CONF.object_storage.catalog_type
self.format = 'json'
def list_account_metadata(self):
@@ -102,12 +105,12 @@
class AccountClientCustomizedHeader(RestClient):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(AccountClientCustomizedHeader, self).__init__(config, username,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(AccountClientCustomizedHeader, self).__init__(username,
password, auth_url,
tenant_name)
# Overwrites json-specific header encoding in RestClient
- self.service = self.config.object_storage.catalog_type
+ self.service = CONF.object_storage.catalog_type
self.format = 'json'
def request(self, method, url, headers=None, body=None):
diff --git a/tempest/services/object_storage/container_client.py b/tempest/services/object_storage/container_client.py
index cbd07bf..4308589 100644
--- a/tempest/services/object_storage/container_client.py
+++ b/tempest/services/object_storage/container_client.py
@@ -17,16 +17,19 @@
import urllib
from tempest.common.rest_client import RestClient
+from tempest import config
+
+CONF = config.CONF
class ContainerClient(RestClient):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(ContainerClient, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(ContainerClient, self).__init__(username, password,
auth_url, tenant_name)
# Overwrites json-specific header encoding in RestClient
self.headers = {}
- self.service = self.config.object_storage.catalog_type
+ self.service = CONF.object_storage.catalog_type
self.format = 'json'
def create_container(self, container_name, metadata=None,
diff --git a/tempest/services/object_storage/object_client.py b/tempest/services/object_storage/object_client.py
index 1304a03..2a68a4f 100644
--- a/tempest/services/object_storage/object_client.py
+++ b/tempest/services/object_storage/object_client.py
@@ -17,15 +17,18 @@
from tempest.common import http
from tempest.common.rest_client import RestClient
+from tempest import config
from tempest import exceptions
+CONF = config.CONF
+
class ObjectClient(RestClient):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(ObjectClient, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(ObjectClient, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.object_storage.catalog_type
+ self.service = CONF.object_storage.catalog_type
def create_object(self, container, object_name, data, params=None):
"""Create storage object."""
@@ -135,17 +138,17 @@
class ObjectClientCustomizedHeader(RestClient):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(ObjectClientCustomizedHeader, self).__init__(config, username,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(ObjectClientCustomizedHeader, self).__init__(username,
password, auth_url,
tenant_name)
# Overwrites json-specific header encoding in RestClient
- self.service = self.config.object_storage.catalog_type
+ self.service = CONF.object_storage.catalog_type
self.format = 'json'
def request(self, method, url, headers=None, body=None):
"""A simple HTTP request interface."""
- dscv = self.config.identity.disable_ssl_certificate_validation
+ dscv = CONF.identity.disable_ssl_certificate_validation
self.http_obj = http.ClosingHttp(
disable_ssl_certificate_validation=dscv)
if headers is None:
diff --git a/tempest/services/orchestration/json/orchestration_client.py b/tempest/services/orchestration/json/orchestration_client.py
index 20f1b06..273c2ae 100644
--- a/tempest/services/orchestration/json/orchestration_client.py
+++ b/tempest/services/orchestration/json/orchestration_client.py
@@ -19,17 +19,20 @@
import urllib
from tempest.common import rest_client
+from tempest import config
from tempest import exceptions
+CONF = config.CONF
+
class OrchestrationClient(rest_client.RestClient):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(OrchestrationClient, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(OrchestrationClient, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.orchestration.catalog_type
- self.build_interval = self.config.orchestration.build_interval
- self.build_timeout = self.config.orchestration.build_timeout
+ self.service = CONF.orchestration.catalog_type
+ self.build_interval = CONF.orchestration.build_interval
+ self.build_timeout = CONF.orchestration.build_timeout
def list_stacks(self, params=None):
"""Lists all stacks for a user."""
diff --git a/tempest/services/telemetry/json/telemetry_client.py b/tempest/services/telemetry/json/telemetry_client.py
index d8662e9..a1112da 100644
--- a/tempest/services/telemetry/json/telemetry_client.py
+++ b/tempest/services/telemetry/json/telemetry_client.py
@@ -20,9 +20,9 @@
class TelemetryClientJSON(client.TelemetryClientBase):
- def get_rest_client(self, config, username,
+ def get_rest_client(self, username,
password, auth_url, tenant_name=None):
- return RestClient(config, username, password, auth_url, tenant_name)
+ return RestClient(username, password, auth_url, tenant_name)
def deserialize(self, body):
return json.loads(body.replace("\n", ""))
diff --git a/tempest/services/telemetry/telemetry_client_base.py b/tempest/services/telemetry/telemetry_client_base.py
index 883bf33..24039c6 100644
--- a/tempest/services/telemetry/telemetry_client_base.py
+++ b/tempest/services/telemetry/telemetry_client_base.py
@@ -17,6 +17,10 @@
import six
import urllib
+from tempest import config
+
+CONF = config.CONF
+
@six.add_metaclass(abc.ABCMeta)
class TelemetryClientBase(object):
@@ -31,17 +35,16 @@
statistics
"""
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- self.rest_client = self.get_rest_client(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ self.rest_client = self.get_rest_client(username, password,
auth_url, tenant_name)
- self.rest_client.service = \
- self.rest_client.config.telemetry.catalog_type
+ self.rest_client.service = CONF.telemetry.catalog_type
self.headers = self.rest_client.headers
self.version = '2'
self.uri_prefix = "v%s" % self.version
@abc.abstractmethod
- def get_rest_client(self, config, username, password,
+ def get_rest_client(self, username, password,
auth_url, tenant_name):
"""
:param config:
diff --git a/tempest/services/telemetry/xml/telemetry_client.py b/tempest/services/telemetry/xml/telemetry_client.py
index ac5fa32..862d08f 100644
--- a/tempest/services/telemetry/xml/telemetry_client.py
+++ b/tempest/services/telemetry/xml/telemetry_client.py
@@ -23,9 +23,9 @@
class TelemetryClientXML(client.TelemetryClientBase):
- def get_rest_client(self, config, username,
+ def get_rest_client(self, username,
password, auth_url, tenant_name=None):
- return RestClientXML(config, username, password, auth_url, tenant_name)
+ return RestClientXML(username, password, auth_url, tenant_name)
def _parse_array(self, body):
array = []
diff --git a/tempest/services/volume/json/admin/volume_hosts_client.py b/tempest/services/volume/json/admin/volume_hosts_client.py
index c9a522a..e4178b9 100644
--- a/tempest/services/volume/json/admin/volume_hosts_client.py
+++ b/tempest/services/volume/json/admin/volume_hosts_client.py
@@ -17,6 +17,9 @@
import urllib
from tempest.common.rest_client import RestClient
+from tempest import config
+
+CONF = config.CONF
class VolumeHostsClientJSON(RestClient):
@@ -24,13 +27,13 @@
Client class to send CRUD Volume Hosts API requests to a Cinder endpoint
"""
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(VolumeHostsClientJSON, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(VolumeHostsClientJSON, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.volume.catalog_type
- self.build_interval = self.config.volume.build_interval
- self.build_timeout = self.config.volume.build_timeout
+ self.service = CONF.volume.catalog_type
+ self.build_interval = CONF.volume.build_interval
+ self.build_timeout = CONF.volume.build_timeout
def list_hosts(self, params=None):
"""Lists all hosts."""
diff --git a/tempest/services/volume/json/admin/volume_types_client.py b/tempest/services/volume/json/admin/volume_types_client.py
index 4ab9b70..5b6328b 100644
--- a/tempest/services/volume/json/admin/volume_types_client.py
+++ b/tempest/services/volume/json/admin/volume_types_client.py
@@ -17,6 +17,9 @@
import urllib
from tempest.common.rest_client import RestClient
+from tempest import config
+
+CONF = config.CONF
class VolumeTypesClientJSON(RestClient):
@@ -24,13 +27,13 @@
Client class to send CRUD Volume Types API requests to a Cinder endpoint
"""
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(VolumeTypesClientJSON, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(VolumeTypesClientJSON, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.volume.catalog_type
- self.build_interval = self.config.volume.build_interval
- self.build_timeout = self.config.volume.build_timeout
+ self.service = CONF.volume.catalog_type
+ self.build_interval = CONF.volume.build_interval
+ self.build_timeout = CONF.volume.build_timeout
def list_volume_types(self, params=None):
"""List all the volume_types created."""
diff --git a/tempest/services/volume/json/extensions_client.py b/tempest/services/volume/json/extensions_client.py
index bdd5f1e..c3bbb20 100644
--- a/tempest/services/volume/json/extensions_client.py
+++ b/tempest/services/volume/json/extensions_client.py
@@ -16,14 +16,17 @@
import json
from tempest.common.rest_client import RestClient
+from tempest import config
+
+CONF = config.CONF
class ExtensionsClientJSON(RestClient):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(ExtensionsClientJSON, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(ExtensionsClientJSON, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.volume.catalog_type
+ self.service = CONF.volume.catalog_type
def list_extensions(self):
url = 'extensions'
diff --git a/tempest/services/volume/json/snapshots_client.py b/tempest/services/volume/json/snapshots_client.py
index 1a34898..a36083b 100644
--- a/tempest/services/volume/json/snapshots_client.py
+++ b/tempest/services/volume/json/snapshots_client.py
@@ -15,22 +15,25 @@
import urllib
from tempest.common.rest_client import RestClient
+from tempest import config
from tempest import exceptions
from tempest.openstack.common import log as logging
+CONF = config.CONF
+
LOG = logging.getLogger(__name__)
class SnapshotsClientJSON(RestClient):
"""Client class to send CRUD Volume API requests."""
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(SnapshotsClientJSON, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(SnapshotsClientJSON, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.volume.catalog_type
- self.build_interval = self.config.volume.build_interval
- self.build_timeout = self.config.volume.build_timeout
+ self.service = CONF.volume.catalog_type
+ self.build_interval = CONF.volume.build_interval
+ self.build_timeout = CONF.volume.build_timeout
def list_snapshots(self, params=None):
"""List all the snapshot."""
diff --git a/tempest/services/volume/json/volumes_client.py b/tempest/services/volume/json/volumes_client.py
index c99501b..6c09e02 100644
--- a/tempest/services/volume/json/volumes_client.py
+++ b/tempest/services/volume/json/volumes_client.py
@@ -18,21 +18,24 @@
import urllib
from tempest.common.rest_client import RestClient
+from tempest import config
from tempest import exceptions
+CONF = config.CONF
+
class VolumesClientJSON(RestClient):
"""
Client class to send CRUD Volume API requests to a Cinder endpoint
"""
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(VolumesClientJSON, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(VolumesClientJSON, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.volume.catalog_type
- self.build_interval = self.config.volume.build_interval
- self.build_timeout = self.config.volume.build_timeout
+ self.service = CONF.volume.catalog_type
+ self.build_interval = CONF.volume.build_interval
+ self.build_timeout = CONF.volume.build_timeout
def get_attachment_from_volume(self, volume):
"""Return the element 'attachment' from input volumes."""
diff --git a/tempest/services/volume/xml/admin/volume_hosts_client.py b/tempest/services/volume/xml/admin/volume_hosts_client.py
index 31e529f..39b82e5 100644
--- a/tempest/services/volume/xml/admin/volume_hosts_client.py
+++ b/tempest/services/volume/xml/admin/volume_hosts_client.py
@@ -18,20 +18,23 @@
from lxml import etree
from tempest.common.rest_client import RestClientXML
+from tempest import config
from tempest.services.compute.xml.common import xml_to_json
+CONF = config.CONF
+
class VolumeHostsClientXML(RestClientXML):
"""
Client class to send CRUD Volume Hosts API requests to a Cinder endpoint
"""
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(VolumeHostsClientXML, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(VolumeHostsClientXML, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.volume.catalog_type
- self.build_interval = self.config.compute.build_interval
- self.build_timeout = self.config.compute.build_timeout
+ self.service = CONF.volume.catalog_type
+ self.build_interval = CONF.compute.build_interval
+ self.build_timeout = CONF.compute.build_timeout
def _parse_array(self, node):
"""
diff --git a/tempest/services/volume/xml/admin/volume_types_client.py b/tempest/services/volume/xml/admin/volume_types_client.py
index 12e70d4..942c4e1 100644
--- a/tempest/services/volume/xml/admin/volume_types_client.py
+++ b/tempest/services/volume/xml/admin/volume_types_client.py
@@ -18,6 +18,7 @@
from lxml import etree
from tempest.common.rest_client import RestClientXML
+from tempest import config
from tempest import exceptions
from tempest.services.compute.xml.common import Document
from tempest.services.compute.xml.common import Element
@@ -25,18 +26,20 @@
from tempest.services.compute.xml.common import xml_to_json
from tempest.services.compute.xml.common import XMLNS_11
+CONF = config.CONF
+
class VolumeTypesClientXML(RestClientXML):
"""
Client class to send CRUD Volume Types API requests to a Cinder endpoint
"""
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(VolumeTypesClientXML, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(VolumeTypesClientXML, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.volume.catalog_type
- self.build_interval = self.config.compute.build_interval
- self.build_timeout = self.config.compute.build_timeout
+ self.service = CONF.volume.catalog_type
+ self.build_interval = CONF.compute.build_interval
+ self.build_timeout = CONF.compute.build_timeout
def _parse_volume_type(self, body):
vol_type = dict((attr, body.get(attr)) for attr in body.keys())
diff --git a/tempest/services/volume/xml/extensions_client.py b/tempest/services/volume/xml/extensions_client.py
index 30997bb..a04616d 100644
--- a/tempest/services/volume/xml/extensions_client.py
+++ b/tempest/services/volume/xml/extensions_client.py
@@ -14,16 +14,20 @@
# under the License.
from lxml import etree
+
from tempest.common.rest_client import RestClientXML
+from tempest import config
from tempest.services.compute.xml.common import xml_to_json
+CONF = config.CONF
+
class ExtensionsClientXML(RestClientXML):
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(ExtensionsClientXML, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(ExtensionsClientXML, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.volume.catalog_type
+ self.service = CONF.volume.catalog_type
def _parse_array(self, node):
array = []
diff --git a/tempest/services/volume/xml/snapshots_client.py b/tempest/services/volume/xml/snapshots_client.py
index ea2ea27..3e85041 100644
--- a/tempest/services/volume/xml/snapshots_client.py
+++ b/tempest/services/volume/xml/snapshots_client.py
@@ -16,6 +16,7 @@
from lxml import etree
from tempest.common.rest_client import RestClientXML
+from tempest import config
from tempest import exceptions
from tempest.openstack.common import log as logging
from tempest.services.compute.xml.common import Document
@@ -24,19 +25,21 @@
from tempest.services.compute.xml.common import xml_to_json
from tempest.services.compute.xml.common import XMLNS_11
+CONF = config.CONF
+
LOG = logging.getLogger(__name__)
class SnapshotsClientXML(RestClientXML):
"""Client class to send CRUD Volume API requests."""
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(SnapshotsClientXML, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(SnapshotsClientXML, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.volume.catalog_type
- self.build_interval = self.config.volume.build_interval
- self.build_timeout = self.config.volume.build_timeout
+ self.service = CONF.volume.catalog_type
+ self.build_interval = CONF.volume.build_interval
+ self.build_timeout = CONF.volume.build_timeout
def list_snapshots(self, params=None):
"""List all snapshot."""
diff --git a/tempest/services/volume/xml/volumes_client.py b/tempest/services/volume/xml/volumes_client.py
index 37370b1..7adaf4b 100644
--- a/tempest/services/volume/xml/volumes_client.py
+++ b/tempest/services/volume/xml/volumes_client.py
@@ -19,6 +19,7 @@
from lxml import etree
from tempest.common.rest_client import RestClientXML
+from tempest import config
from tempest import exceptions
from tempest.services.compute.xml.common import Document
from tempest.services.compute.xml.common import Element
@@ -26,18 +27,20 @@
from tempest.services.compute.xml.common import xml_to_json
from tempest.services.compute.xml.common import XMLNS_11
+CONF = config.CONF
+
class VolumesClientXML(RestClientXML):
"""
Client class to send CRUD Volume API requests to a Cinder endpoint
"""
- def __init__(self, config, username, password, auth_url, tenant_name=None):
- super(VolumesClientXML, self).__init__(config, username, password,
+ def __init__(self, username, password, auth_url, tenant_name=None):
+ super(VolumesClientXML, self).__init__(username, password,
auth_url, tenant_name)
- self.service = self.config.volume.catalog_type
- self.build_interval = self.config.compute.build_interval
- self.build_timeout = self.config.compute.build_timeout
+ self.service = CONF.volume.catalog_type
+ self.build_interval = CONF.compute.build_interval
+ self.build_timeout = CONF.compute.build_timeout
def _parse_volume(self, body):
vol = dict((attr, body.get(attr)) for attr in body.keys())
diff --git a/tempest/tests/test_rest_client.py b/tempest/tests/test_rest_client.py
index acb9000..f3c7440 100644
--- a/tempest/tests/test_rest_client.py
+++ b/tempest/tests/test_rest_client.py
@@ -15,6 +15,7 @@
import httplib2
from tempest.common import rest_client
+from tempest import config
from tempest import exceptions
from tempest.openstack.common.fixture import mockpatch
from tempest.tests import base
@@ -29,8 +30,8 @@
def setUp(self):
super(BaseRestClientTestClass, self).setUp()
- self.rest_client = rest_client.RestClient(fake_config.FakeConfig(),
- 'fake_user', 'fake_pass',
+ self.stubs.Set(config, 'TempestConfigPrivate', fake_config.FakeConfig)
+ self.rest_client = rest_client.RestClient('fake_user', 'fake_pass',
'http://fake_url/v2.0')
self.stubs.Set(httplib2.Http, 'request', self.fake_http.request)
self.useFixture(mockpatch.PatchObject(self.rest_client, '_set_auth',