From 960eeb49f52503a3c0e3042c30612f95822c48ec Mon Sep 17 00:00:00 2001 From: vponomaryov Date: Sat, 22 Feb 2014 18:25:25 +0200 Subject: [PATCH] Removed RestClientXML class After unifying RestClient class to handle both container types - json and xml, class RestClientXML becomes redundant. Change-Id: I1bcf5e4df130b8eee26d0abcf1741ba3ea8f3d00 Partially-implements: bp refactor-rest-client --- tempest/common/rest_client.py | 18 ------------------ .../services/compute/xml/aggregates_client.py | 5 +++-- .../compute/xml/availability_zone_client.py | 5 +++-- .../compute/xml/certificates_client.py | 5 +++-- .../services/compute/xml/extensions_client.py | 5 +++-- .../services/compute/xml/fixed_ips_client.py | 5 +++-- tempest/services/compute/xml/flavors_client.py | 5 +++-- .../compute/xml/floating_ips_client.py | 6 ++++-- tempest/services/compute/xml/hosts_client.py | 5 +++-- .../services/compute/xml/hypervisor_client.py | 5 +++-- tempest/services/compute/xml/images_client.py | 5 +++-- .../xml/instance_usage_audit_log_client.py | 5 +++-- .../services/compute/xml/interfaces_client.py | 5 +++-- .../services/compute/xml/keypairs_client.py | 5 +++-- tempest/services/compute/xml/limits_client.py | 5 +++-- tempest/services/compute/xml/quotas_client.py | 5 +++-- .../compute/xml/security_groups_client.py | 5 +++-- tempest/services/compute/xml/servers_client.py | 5 +++-- .../services/compute/xml/services_client.py | 5 +++-- .../compute/xml/tenant_usages_client.py | 5 +++-- .../compute/xml/volumes_extensions_client.py | 5 +++-- .../identity/v3/xml/credentials_client.py | 5 +++-- .../identity/v3/xml/endpoints_client.py | 5 +++-- .../identity/v3/xml/identity_client.py | 8 +++++--- .../services/identity/v3/xml/policy_client.py | 5 +++-- .../services/identity/v3/xml/service_client.py | 5 +++-- tempest/services/network/xml/network_client.py | 7 +++++-- .../services/telemetry/xml/telemetry_client.py | 7 +++++-- .../services/volume/v2/xml/volumes_client.py | 5 +++-- .../volume/xml/admin/volume_hosts_client.py | 5 +++-- .../volume/xml/admin/volume_types_client.py | 5 +++-- tempest/services/volume/xml/backups_client.py | 5 +++-- .../services/volume/xml/extensions_client.py | 5 +++-- .../services/volume/xml/snapshots_client.py | 5 +++-- tempest/services/volume/xml/volumes_client.py | 5 +++-- 35 files changed, 109 insertions(+), 87 deletions(-) diff --git a/tempest/common/rest_client.py b/tempest/common/rest_client.py index 5064f076ed..03dccd469b 100644 --- a/tempest/common/rest_client.py +++ b/tempest/common/rest_client.py @@ -502,24 +502,6 @@ class RestClient(object): raise NotImplementedError(message) -class RestClientXML(RestClient): - - # NOTE(vponomaryov): This is deprecated class - # and should be removed after excluding it - # from all service clients - - TYPE = "xml" - - def _parse_resp(self, body): - return xml_to_json(etree.fromstring(body)) - - def is_absolute_limit(self, resp, resp_body): - if (not isinstance(resp_body, collections.Mapping) or - 'retry-after' not in resp): - return True - return 'exceed' in resp_body.get('message', 'blabla') - - class NegativeRestClient(RestClient): """ Version of RestClient that does not raise exceptions. diff --git a/tempest/services/compute/xml/aggregates_client.py b/tempest/services/compute/xml/aggregates_client.py index cf853baf09..5b250ee68f 100644 --- a/tempest/services/compute/xml/aggregates_client.py +++ b/tempest/services/compute/xml/aggregates_client.py @@ -15,7 +15,7 @@ from lxml import etree -from tempest.common.rest_client import RestClientXML +from tempest.common import rest_client from tempest import config from tempest import exceptions from tempest.services.compute.xml.common import Document @@ -26,7 +26,8 @@ from tempest.services.compute.xml.common import xml_to_json CONF = config.CONF -class AggregatesClientXML(RestClientXML): +class AggregatesClientXML(rest_client.RestClient): + TYPE = "xml" def __init__(self, auth_provider): super(AggregatesClientXML, self).__init__(auth_provider) diff --git a/tempest/services/compute/xml/availability_zone_client.py b/tempest/services/compute/xml/availability_zone_client.py index 3d8ac8afb4..4d71186c34 100644 --- a/tempest/services/compute/xml/availability_zone_client.py +++ b/tempest/services/compute/xml/availability_zone_client.py @@ -15,14 +15,15 @@ from lxml import etree -from tempest.common.rest_client import RestClientXML +from tempest.common import rest_client from tempest import config from tempest.services.compute.xml.common import xml_to_json CONF = config.CONF -class AvailabilityZoneClientXML(RestClientXML): +class AvailabilityZoneClientXML(rest_client.RestClient): + TYPE = "xml" def __init__(self, auth_provider): super(AvailabilityZoneClientXML, self).__init__( diff --git a/tempest/services/compute/xml/certificates_client.py b/tempest/services/compute/xml/certificates_client.py index 4ee10c4985..24ffca8598 100644 --- a/tempest/services/compute/xml/certificates_client.py +++ b/tempest/services/compute/xml/certificates_client.py @@ -14,13 +14,14 @@ # under the License. -from tempest.common.rest_client import RestClientXML +from tempest.common import rest_client from tempest import config CONF = config.CONF -class CertificatesClientXML(RestClientXML): +class CertificatesClientXML(rest_client.RestClient): + TYPE = "xml" def __init__(self, auth_provider): super(CertificatesClientXML, self).__init__(auth_provider) diff --git a/tempest/services/compute/xml/extensions_client.py b/tempest/services/compute/xml/extensions_client.py index f97b64d5a0..3e8254cbb5 100644 --- a/tempest/services/compute/xml/extensions_client.py +++ b/tempest/services/compute/xml/extensions_client.py @@ -15,14 +15,15 @@ from lxml import etree -from tempest.common.rest_client import RestClientXML +from tempest.common import rest_client from tempest import config from tempest.services.compute.xml.common import xml_to_json CONF = config.CONF -class ExtensionsClientXML(RestClientXML): +class ExtensionsClientXML(rest_client.RestClient): + TYPE = "xml" def __init__(self, auth_provider): super(ExtensionsClientXML, self).__init__(auth_provider) diff --git a/tempest/services/compute/xml/fixed_ips_client.py b/tempest/services/compute/xml/fixed_ips_client.py index b89e096292..0475530d60 100644 --- a/tempest/services/compute/xml/fixed_ips_client.py +++ b/tempest/services/compute/xml/fixed_ips_client.py @@ -14,7 +14,7 @@ # under the License. -from tempest.common.rest_client import RestClientXML +from tempest.common import rest_client from tempest import config from tempest.services.compute.xml.common import Document from tempest.services.compute.xml.common import Element @@ -23,7 +23,8 @@ from tempest.services.compute.xml.common import Text CONF = config.CONF -class FixedIPsClientXML(RestClientXML): +class FixedIPsClientXML(rest_client.RestClient): + TYPE = "xml" def __init__(self, auth_provider): super(FixedIPsClientXML, self).__init__(auth_provider) diff --git a/tempest/services/compute/xml/flavors_client.py b/tempest/services/compute/xml/flavors_client.py index 554b253639..68a27c9328 100644 --- a/tempest/services/compute/xml/flavors_client.py +++ b/tempest/services/compute/xml/flavors_client.py @@ -17,7 +17,7 @@ import urllib from lxml import etree -from tempest.common.rest_client import RestClientXML +from tempest.common import rest_client from tempest import config from tempest.services.compute.xml.common import Document from tempest.services.compute.xml.common import Element @@ -33,7 +33,8 @@ XMLNS_OS_FLV_ACCESS = \ "http://docs.openstack.org/compute/ext/flavor_access/api/v2" -class FlavorsClientXML(RestClientXML): +class FlavorsClientXML(rest_client.RestClient): + TYPE = "xml" def __init__(self, auth_provider): super(FlavorsClientXML, self).__init__(auth_provider) diff --git a/tempest/services/compute/xml/floating_ips_client.py b/tempest/services/compute/xml/floating_ips_client.py index d6decf3ded..be547533b6 100644 --- a/tempest/services/compute/xml/floating_ips_client.py +++ b/tempest/services/compute/xml/floating_ips_client.py @@ -16,7 +16,7 @@ from lxml import etree import urllib -from tempest.common.rest_client import RestClientXML +from tempest.common import rest_client from tempest import config from tempest import exceptions from tempest.services.compute.xml.common import Document @@ -27,7 +27,9 @@ from tempest.services.compute.xml.common import xml_to_json CONF = config.CONF -class FloatingIPsClientXML(RestClientXML): +class FloatingIPsClientXML(rest_client.RestClient): + TYPE = "xml" + def __init__(self, auth_provider): super(FloatingIPsClientXML, self).__init__(auth_provider) self.service = CONF.compute.catalog_type diff --git a/tempest/services/compute/xml/hosts_client.py b/tempest/services/compute/xml/hosts_client.py index 13abe182fa..b74cd040b3 100644 --- a/tempest/services/compute/xml/hosts_client.py +++ b/tempest/services/compute/xml/hosts_client.py @@ -15,7 +15,7 @@ import urllib from lxml import etree -from tempest.common.rest_client import RestClientXML +from tempest.common import rest_client from tempest import config from tempest.services.compute.xml.common import Document from tempest.services.compute.xml.common import Element @@ -24,7 +24,8 @@ from tempest.services.compute.xml.common import xml_to_json CONF = config.CONF -class HostsClientXML(RestClientXML): +class HostsClientXML(rest_client.RestClient): + TYPE = "xml" def __init__(self, auth_provider): super(HostsClientXML, self).__init__(auth_provider) diff --git a/tempest/services/compute/xml/hypervisor_client.py b/tempest/services/compute/xml/hypervisor_client.py index 3c1ef08f02..ecd75416a7 100644 --- a/tempest/services/compute/xml/hypervisor_client.py +++ b/tempest/services/compute/xml/hypervisor_client.py @@ -15,14 +15,15 @@ from lxml import etree -from tempest.common.rest_client import RestClientXML +from tempest.common import rest_client from tempest import config from tempest.services.compute.xml.common import xml_to_json CONF = config.CONF -class HypervisorClientXML(RestClientXML): +class HypervisorClientXML(rest_client.RestClient): + TYPE = "xml" def __init__(self, auth_provider): super(HypervisorClientXML, self).__init__(auth_provider) diff --git a/tempest/services/compute/xml/images_client.py b/tempest/services/compute/xml/images_client.py index 9f80c55e96..9d529be473 100644 --- a/tempest/services/compute/xml/images_client.py +++ b/tempest/services/compute/xml/images_client.py @@ -17,7 +17,7 @@ import urllib from lxml import etree -from tempest.common.rest_client import RestClientXML +from tempest.common import rest_client from tempest.common import waiters from tempest import config from tempest import exceptions @@ -30,7 +30,8 @@ from tempest.services.compute.xml.common import XMLNS_11 CONF = config.CONF -class ImagesClientXML(RestClientXML): +class ImagesClientXML(rest_client.RestClient): + TYPE = "xml" def __init__(self, auth_provider): super(ImagesClientXML, self).__init__(auth_provider) 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 baa69667ce..1cd8c0791c 100644 --- a/tempest/services/compute/xml/instance_usage_audit_log_client.py +++ b/tempest/services/compute/xml/instance_usage_audit_log_client.py @@ -15,14 +15,15 @@ from lxml import etree -from tempest.common.rest_client import RestClientXML +from tempest.common import rest_client from tempest import config from tempest.services.compute.xml.common import xml_to_json CONF = config.CONF -class InstanceUsagesAuditLogClientXML(RestClientXML): +class InstanceUsagesAuditLogClientXML(rest_client.RestClient): + TYPE = "xml" def __init__(self, auth_provider): super(InstanceUsagesAuditLogClientXML, self).__init__( diff --git a/tempest/services/compute/xml/interfaces_client.py b/tempest/services/compute/xml/interfaces_client.py index 6155cd616f..5df6187ecd 100644 --- a/tempest/services/compute/xml/interfaces_client.py +++ b/tempest/services/compute/xml/interfaces_client.py @@ -17,7 +17,7 @@ import time from lxml import etree -from tempest.common.rest_client import RestClientXML +from tempest.common import rest_client from tempest import config from tempest import exceptions from tempest.services.compute.xml.common import Document @@ -28,7 +28,8 @@ from tempest.services.compute.xml.common import xml_to_json CONF = config.CONF -class InterfacesClientXML(RestClientXML): +class InterfacesClientXML(rest_client.RestClient): + TYPE = "xml" def __init__(self, auth_provider): super(InterfacesClientXML, self).__init__(auth_provider) diff --git a/tempest/services/compute/xml/keypairs_client.py b/tempest/services/compute/xml/keypairs_client.py index 5641251832..fb498c0c57 100644 --- a/tempest/services/compute/xml/keypairs_client.py +++ b/tempest/services/compute/xml/keypairs_client.py @@ -16,7 +16,7 @@ from lxml import etree -from tempest.common.rest_client import RestClientXML +from tempest.common import rest_client from tempest import config from tempest.services.compute.xml.common import Document from tempest.services.compute.xml.common import Element @@ -26,7 +26,8 @@ from tempest.services.compute.xml.common import xml_to_json CONF = config.CONF -class KeyPairsClientXML(RestClientXML): +class KeyPairsClientXML(rest_client.RestClient): + TYPE = "xml" def __init__(self, auth_provider): super(KeyPairsClientXML, self).__init__(auth_provider) diff --git a/tempest/services/compute/xml/limits_client.py b/tempest/services/compute/xml/limits_client.py index 61c434c651..232762672b 100644 --- a/tempest/services/compute/xml/limits_client.py +++ b/tempest/services/compute/xml/limits_client.py @@ -15,7 +15,7 @@ from lxml import objectify -from tempest.common.rest_client import RestClientXML +from tempest.common import rest_client from tempest import config CONF = config.CONF @@ -23,7 +23,8 @@ CONF = config.CONF NS = "{http://docs.openstack.org/common/api/v1.0}" -class LimitsClientXML(RestClientXML): +class LimitsClientXML(rest_client.RestClient): + TYPE = "xml" def __init__(self, auth_provider): super(LimitsClientXML, self).__init__(auth_provider) diff --git a/tempest/services/compute/xml/quotas_client.py b/tempest/services/compute/xml/quotas_client.py index 00c327578d..eb287c2fa7 100644 --- a/tempest/services/compute/xml/quotas_client.py +++ b/tempest/services/compute/xml/quotas_client.py @@ -15,7 +15,7 @@ from lxml import etree -from tempest.common.rest_client import RestClientXML +from tempest.common import rest_client from tempest import config from tempest.services.compute.xml.common import Document from tempest.services.compute.xml.common import Element @@ -25,7 +25,8 @@ from tempest.services.compute.xml.common import XMLNS_11 CONF = config.CONF -class QuotasClientXML(RestClientXML): +class QuotasClientXML(rest_client.RestClient): + TYPE = "xml" def __init__(self, auth_provider): super(QuotasClientXML, self).__init__(auth_provider) diff --git a/tempest/services/compute/xml/security_groups_client.py b/tempest/services/compute/xml/security_groups_client.py index 947f6da6dd..d53e8da07f 100644 --- a/tempest/services/compute/xml/security_groups_client.py +++ b/tempest/services/compute/xml/security_groups_client.py @@ -16,7 +16,7 @@ from lxml import etree import urllib -from tempest.common.rest_client import RestClientXML +from tempest.common import rest_client from tempest import config from tempest import exceptions from tempest.services.compute.xml.common import Document @@ -28,7 +28,8 @@ from tempest.services.compute.xml.common import XMLNS_11 CONF = config.CONF -class SecurityGroupsClientXML(RestClientXML): +class SecurityGroupsClientXML(rest_client.RestClient): + TYPE = "xml" def __init__(self, auth_provider): super(SecurityGroupsClientXML, self).__init__(auth_provider) diff --git a/tempest/services/compute/xml/servers_client.py b/tempest/services/compute/xml/servers_client.py index a182d35b01..da01b83c4f 100644 --- a/tempest/services/compute/xml/servers_client.py +++ b/tempest/services/compute/xml/servers_client.py @@ -19,7 +19,7 @@ import urllib from lxml import etree -from tempest.common.rest_client import RestClientXML +from tempest.common import rest_client from tempest.common import waiters from tempest import config from tempest import exceptions @@ -139,7 +139,8 @@ def _translate_server_xml_to_json(xml_dom): return json -class ServersClientXML(RestClientXML): +class ServersClientXML(rest_client.RestClient): + TYPE = "xml" def __init__(self, auth_provider): super(ServersClientXML, self).__init__(auth_provider) diff --git a/tempest/services/compute/xml/services_client.py b/tempest/services/compute/xml/services_client.py index 5943ea9a87..d7b8a604fb 100644 --- a/tempest/services/compute/xml/services_client.py +++ b/tempest/services/compute/xml/services_client.py @@ -18,7 +18,7 @@ import urllib from lxml import etree -from tempest.common.rest_client import RestClientXML +from tempest.common import rest_client from tempest import config from tempest.services.compute.xml.common import Document from tempest.services.compute.xml.common import Element @@ -27,7 +27,8 @@ from tempest.services.compute.xml.common import xml_to_json CONF = config.CONF -class ServicesClientXML(RestClientXML): +class ServicesClientXML(rest_client.RestClient): + TYPE = "xml" def __init__(self, auth_provider): super(ServicesClientXML, self).__init__(auth_provider) diff --git a/tempest/services/compute/xml/tenant_usages_client.py b/tempest/services/compute/xml/tenant_usages_client.py index 96c3147fcb..79f0ac93bd 100644 --- a/tempest/services/compute/xml/tenant_usages_client.py +++ b/tempest/services/compute/xml/tenant_usages_client.py @@ -17,14 +17,15 @@ import urllib from lxml import etree -from tempest.common.rest_client import RestClientXML +from tempest.common import rest_client from tempest import config from tempest.services.compute.xml.common import xml_to_json CONF = config.CONF -class TenantUsagesClientXML(RestClientXML): +class TenantUsagesClientXML(rest_client.RestClient): + TYPE = "xml" def __init__(self, auth_provider): super(TenantUsagesClientXML, self).__init__(auth_provider) diff --git a/tempest/services/compute/xml/volumes_extensions_client.py b/tempest/services/compute/xml/volumes_extensions_client.py index a43fc21daa..570b715f2f 100644 --- a/tempest/services/compute/xml/volumes_extensions_client.py +++ b/tempest/services/compute/xml/volumes_extensions_client.py @@ -18,7 +18,7 @@ import urllib from lxml import etree -from tempest.common.rest_client import RestClientXML +from tempest.common import rest_client from tempest import config from tempest import exceptions from tempest.services.compute.xml.common import Document @@ -30,7 +30,8 @@ from tempest.services.compute.xml.common import XMLNS_11 CONF = config.CONF -class VolumesExtensionsClientXML(RestClientXML): +class VolumesExtensionsClientXML(rest_client.RestClient): + TYPE = "xml" def __init__(self, auth_provider): super(VolumesExtensionsClientXML, self).__init__( diff --git a/tempest/services/identity/v3/xml/credentials_client.py b/tempest/services/identity/v3/xml/credentials_client.py index f6fa6785fc..22ed44d984 100644 --- a/tempest/services/identity/v3/xml/credentials_client.py +++ b/tempest/services/identity/v3/xml/credentials_client.py @@ -17,7 +17,7 @@ import json from lxml import etree -from tempest.common.rest_client import RestClientXML +from tempest.common import rest_client from tempest import config from tempest.services.compute.xml.common import Document from tempest.services.compute.xml.common import Element @@ -29,7 +29,8 @@ CONF = config.CONF XMLNS = "http://docs.openstack.org/identity/api/v3" -class CredentialsClientXML(RestClientXML): +class CredentialsClientXML(rest_client.RestClient): + TYPE = "xml" def __init__(self, auth_provider): super(CredentialsClientXML, self).__init__(auth_provider) diff --git a/tempest/services/identity/v3/xml/endpoints_client.py b/tempest/services/identity/v3/xml/endpoints_client.py index 2a88c15b49..a32eedeb48 100644 --- a/tempest/services/identity/v3/xml/endpoints_client.py +++ b/tempest/services/identity/v3/xml/endpoints_client.py @@ -16,7 +16,7 @@ from lxml import etree from tempest.common import http -from tempest.common.rest_client import RestClientXML +from tempest.common import rest_client from tempest import config from tempest.services.compute.xml.common import Document from tempest.services.compute.xml.common import Element @@ -27,7 +27,8 @@ CONF = config.CONF XMLNS = "http://docs.openstack.org/identity/api/v3" -class EndPointClientXML(RestClientXML): +class EndPointClientXML(rest_client.RestClient): + TYPE = "xml" def __init__(self, auth_provider): super(EndPointClientXML, self).__init__(auth_provider) diff --git a/tempest/services/identity/v3/xml/identity_client.py b/tempest/services/identity/v3/xml/identity_client.py index 5ae0461df4..e8e70d839c 100644 --- a/tempest/services/identity/v3/xml/identity_client.py +++ b/tempest/services/identity/v3/xml/identity_client.py @@ -17,7 +17,7 @@ import json from lxml import etree -from tempest.common.rest_client import RestClientXML +from tempest.common import rest_client from tempest import config from tempest import exceptions from tempest.services.compute.xml.common import Document @@ -30,7 +30,8 @@ CONF = config.CONF XMLNS = "http://docs.openstack.org/identity/api/v3" -class IdentityV3ClientXML(RestClientXML): +class IdentityV3ClientXML(rest_client.RestClient): + TYPE = "xml" def __init__(self, auth_provider): super(IdentityV3ClientXML, self).__init__(auth_provider) @@ -426,7 +427,8 @@ class IdentityV3ClientXML(RestClientXML): return resp, body -class V3TokenClientXML(RestClientXML): +class V3TokenClientXML(rest_client.RestClient): + TYPE = "xml" def __init__(self): super(V3TokenClientXML, self).__init__(None) diff --git a/tempest/services/identity/v3/xml/policy_client.py b/tempest/services/identity/v3/xml/policy_client.py index a7e63a7adb..c12018ac19 100644 --- a/tempest/services/identity/v3/xml/policy_client.py +++ b/tempest/services/identity/v3/xml/policy_client.py @@ -16,7 +16,7 @@ from lxml import etree from tempest.common import http -from tempest.common.rest_client import RestClientXML +from tempest.common import rest_client from tempest import config from tempest.services.compute.xml.common import Document from tempest.services.compute.xml.common import Element @@ -27,7 +27,8 @@ CONF = config.CONF XMLNS = "http://docs.openstack.org/identity/api/v3" -class PolicyClientXML(RestClientXML): +class PolicyClientXML(rest_client.RestClient): + TYPE = "xml" def __init__(self, auth_provider): super(PolicyClientXML, self).__init__(auth_provider) diff --git a/tempest/services/identity/v3/xml/service_client.py b/tempest/services/identity/v3/xml/service_client.py index be6c443538..d5476c451c 100644 --- a/tempest/services/identity/v3/xml/service_client.py +++ b/tempest/services/identity/v3/xml/service_client.py @@ -15,7 +15,7 @@ from lxml import etree -from tempest.common.rest_client import RestClientXML +from tempest.common import rest_client from tempest import config from tempest.services.compute.xml.common import Document from tempest.services.compute.xml.common import Element @@ -26,7 +26,8 @@ CONF = config.CONF XMLNS = "http://docs.openstack.org/identity/api/v3" -class ServiceClientXML(RestClientXML): +class ServiceClientXML(rest_client.RestClient): + TYPE = "xml" def __init__(self, auth_provider): super(ServiceClientXML, self).__init__(auth_provider) diff --git a/tempest/services/network/xml/network_client.py b/tempest/services/network/xml/network_client.py index e6f5c0825d..a669efc980 100644 --- a/tempest/services/network/xml/network_client.py +++ b/tempest/services/network/xml/network_client.py @@ -13,7 +13,7 @@ from lxml import etree import xml.etree.ElementTree as ET -from tempest.common.rest_client import RestClientXML +from tempest.common import rest_client from tempest.services.compute.xml.common import deep_dict_to_xml from tempest.services.compute.xml.common import Document from tempest.services.compute.xml.common import Element @@ -23,13 +23,16 @@ from tempest.services.network import network_client_base as client_base class NetworkClientXML(client_base.NetworkClientBase): + TYPE = "xml" # list of plurals used for xml serialization PLURALS = ['dns_nameservers', 'host_routes', 'allocation_pools', 'fixed_ips', 'extensions'] def get_rest_client(self, auth_provider): - return RestClientXML(auth_provider) + rc = rest_client.RestClient(auth_provider) + rc.TYPE = self.TYPE + return rc def _parse_array(self, node): array = [] diff --git a/tempest/services/telemetry/xml/telemetry_client.py b/tempest/services/telemetry/xml/telemetry_client.py index f29fe22975..165f29a1fc 100644 --- a/tempest/services/telemetry/xml/telemetry_client.py +++ b/tempest/services/telemetry/xml/telemetry_client.py @@ -15,16 +15,19 @@ from lxml import etree -from tempest.common.rest_client import RestClientXML +from tempest.common import rest_client from tempest.services.compute.xml.common import Document from tempest.services.compute.xml.common import xml_to_json import tempest.services.telemetry.telemetry_client_base as client class TelemetryClientXML(client.TelemetryClientBase): + TYPE = "xml" def get_rest_client(self, auth_provider): - return RestClientXML(auth_provider) + rc = rest_client.RestClient(auth_provider) + rc.TYPE = self.TYPE + return rc def _parse_array(self, body): array = [] diff --git a/tempest/services/volume/v2/xml/volumes_client.py b/tempest/services/volume/v2/xml/volumes_client.py index 69e3f5b36b..bc57842582 100644 --- a/tempest/services/volume/v2/xml/volumes_client.py +++ b/tempest/services/volume/v2/xml/volumes_client.py @@ -18,7 +18,7 @@ import urllib from lxml import etree -from tempest.common.rest_client import RestClientXML +from tempest.common import rest_client from tempest import config from tempest import exceptions from tempest.services.compute.xml.common import Document @@ -30,10 +30,11 @@ from tempest.services.compute.xml.common import XMLNS_11 CONF = config.CONF -class VolumesV2ClientXML(RestClientXML): +class VolumesV2ClientXML(rest_client.RestClient): """ Client class to send CRUD Volume API requests to a Cinder endpoint """ + TYPE = "xml" def __init__(self, auth_provider): super(VolumesV2ClientXML, self).__init__(auth_provider) diff --git a/tempest/services/volume/xml/admin/volume_hosts_client.py b/tempest/services/volume/xml/admin/volume_hosts_client.py index 080e3d16e1..fb84c838ec 100644 --- a/tempest/services/volume/xml/admin/volume_hosts_client.py +++ b/tempest/services/volume/xml/admin/volume_hosts_client.py @@ -17,17 +17,18 @@ import urllib from lxml import etree -from tempest.common.rest_client import RestClientXML +from tempest.common import rest_client from tempest import config from tempest.services.compute.xml.common import xml_to_json CONF = config.CONF -class VolumeHostsClientXML(RestClientXML): +class VolumeHostsClientXML(rest_client.RestClient): """ Client class to send CRUD Volume Hosts API requests to a Cinder endpoint """ + TYPE = "xml" def __init__(self, auth_provider): super(VolumeHostsClientXML, self).__init__(auth_provider) diff --git a/tempest/services/volume/xml/admin/volume_types_client.py b/tempest/services/volume/xml/admin/volume_types_client.py index 802d27aaae..77bafec2e2 100644 --- a/tempest/services/volume/xml/admin/volume_types_client.py +++ b/tempest/services/volume/xml/admin/volume_types_client.py @@ -17,7 +17,7 @@ import urllib from lxml import etree -from tempest.common.rest_client import RestClientXML +from tempest.common import rest_client from tempest import config from tempest import exceptions from tempest.services.compute.xml.common import Document @@ -29,10 +29,11 @@ from tempest.services.compute.xml.common import XMLNS_11 CONF = config.CONF -class VolumeTypesClientXML(RestClientXML): +class VolumeTypesClientXML(rest_client.RestClient): """ Client class to send CRUD Volume Types API requests to a Cinder endpoint """ + TYPE = "xml" def __init__(self, auth_provider): super(VolumeTypesClientXML, self).__init__(auth_provider) diff --git a/tempest/services/volume/xml/backups_client.py b/tempest/services/volume/xml/backups_client.py index 6a71f8b9d6..81caaee9b1 100644 --- a/tempest/services/volume/xml/backups_client.py +++ b/tempest/services/volume/xml/backups_client.py @@ -13,13 +13,14 @@ # License for the specific language governing permissions and limitations # under the License. -from tempest.common.rest_client import RestClientXML +from tempest.services.volume.json import backups_client -class BackupsClientXML(RestClientXML): +class BackupsClientXML(backups_client.BackupsClientJSON): """ Client class to send CRUD Volume Backup API requests to a Cinder endpoint """ + TYPE = "xml" #TODO(gfidente): XML client isn't yet implemented because of bug 1270589 pass diff --git a/tempest/services/volume/xml/extensions_client.py b/tempest/services/volume/xml/extensions_client.py index 03743a681f..1ea974fcf5 100644 --- a/tempest/services/volume/xml/extensions_client.py +++ b/tempest/services/volume/xml/extensions_client.py @@ -15,14 +15,15 @@ from lxml import etree -from tempest.common.rest_client import RestClientXML +from tempest.common import rest_client from tempest import config from tempest.services.compute.xml.common import xml_to_json CONF = config.CONF -class ExtensionsClientXML(RestClientXML): +class ExtensionsClientXML(rest_client.RestClient): + TYPE = "xml" def __init__(self, auth_provider): super(ExtensionsClientXML, self).__init__(auth_provider) diff --git a/tempest/services/volume/xml/snapshots_client.py b/tempest/services/volume/xml/snapshots_client.py index 9abe04275a..458001b5da 100644 --- a/tempest/services/volume/xml/snapshots_client.py +++ b/tempest/services/volume/xml/snapshots_client.py @@ -15,7 +15,7 @@ import urllib from lxml import etree -from tempest.common.rest_client import RestClientXML +from tempest.common import rest_client from tempest import config from tempest import exceptions from tempest.openstack.common import log as logging @@ -30,8 +30,9 @@ CONF = config.CONF LOG = logging.getLogger(__name__) -class SnapshotsClientXML(RestClientXML): +class SnapshotsClientXML(rest_client.RestClient): """Client class to send CRUD Volume API requests.""" + TYPE = "xml" def __init__(self, auth_provider): super(SnapshotsClientXML, self).__init__(auth_provider) diff --git a/tempest/services/volume/xml/volumes_client.py b/tempest/services/volume/xml/volumes_client.py index 94c1ff61ff..aef1e3c1ea 100644 --- a/tempest/services/volume/xml/volumes_client.py +++ b/tempest/services/volume/xml/volumes_client.py @@ -19,7 +19,7 @@ import urllib from lxml import etree from xml.sax.saxutils import escape -from tempest.common.rest_client import RestClientXML +from tempest.common import rest_client from tempest import config from tempest import exceptions from tempest.services.compute.xml.common import Document @@ -31,10 +31,11 @@ from tempest.services.compute.xml.common import XMLNS_11 CONF = config.CONF -class VolumesClientXML(RestClientXML): +class VolumesClientXML(rest_client.RestClient): """ Client class to send CRUD Volume API requests to a Cinder endpoint """ + TYPE = "xml" def __init__(self, auth_provider): super(VolumesClientXML, self).__init__(auth_provider)