Merge "purge xml clients from tempest.clients"
diff --git a/tempest/clients.py b/tempest/clients.py
index 756614d..486eef2 100644
--- a/tempest/clients.py
+++ b/tempest/clients.py
@@ -16,7 +16,6 @@
from tempest import auth
from tempest.common import rest_client
from tempest import config
-from tempest import exceptions
from tempest import manager
from tempest.openstack.common import log as logging
from tempest.services.baremetal.v1.client_json import BaremetalClientJSON
@@ -87,35 +86,6 @@
ServicesV3ClientJSON
from tempest.services.compute.v3.json.version_client import \
VersionV3ClientJSON
-from tempest.services.compute.xml.aggregates_client import AggregatesClientXML
-from tempest.services.compute.xml.availability_zone_client import \
- AvailabilityZoneClientXML
-from tempest.services.compute.xml.certificates_client import \
- CertificatesClientXML
-from tempest.services.compute.xml.extensions_client import ExtensionsClientXML
-from tempest.services.compute.xml.fixed_ips_client import FixedIPsClientXML
-from tempest.services.compute.xml.flavors_client import FlavorsClientXML
-from tempest.services.compute.xml.floating_ips_client import \
- FloatingIPsClientXML
-from tempest.services.compute.xml.hosts_client import HostsClientXML
-from tempest.services.compute.xml.hypervisor_client import HypervisorClientXML
-from tempest.services.compute.xml.images_client import ImagesClientXML
-from tempest.services.compute.xml.instance_usage_audit_log_client import \
- InstanceUsagesAuditLogClientXML
-from tempest.services.compute.xml.interfaces_client import \
- InterfacesClientXML
-from tempest.services.compute.xml.keypairs_client import KeyPairsClientXML
-from tempest.services.compute.xml.limits_client import LimitsClientXML
-from tempest.services.compute.xml.quotas_client import QuotaClassesClientXML
-from tempest.services.compute.xml.quotas_client import QuotasClientXML
-from tempest.services.compute.xml.security_groups_client \
- import SecurityGroupsClientXML
-from tempest.services.compute.xml.servers_client import ServersClientXML
-from tempest.services.compute.xml.services_client import ServicesClientXML
-from tempest.services.compute.xml.tenant_usages_client import \
- TenantUsagesClientXML
-from tempest.services.compute.xml.volumes_extensions_client import \
- VolumesExtensionsClientXML
from tempest.services.data_processing.v1_1.client import DataProcessingClient
from tempest.services.database.json.flavors_client import \
DatabaseFlavorsClientJSON
@@ -134,24 +104,11 @@
from tempest.services.identity.v3.json.region_client import RegionClientJSON
from tempest.services.identity.v3.json.service_client import \
ServiceClientJSON
-from tempest.services.identity.v3.xml.credentials_client import \
- CredentialsClientXML
-from tempest.services.identity.v3.xml.endpoints_client import EndPointClientXML
-from tempest.services.identity.v3.xml.identity_client import \
- IdentityV3ClientXML
-from tempest.services.identity.v3.xml.identity_client import V3TokenClientXML
-from tempest.services.identity.v3.xml.policy_client import PolicyClientXML
-from tempest.services.identity.v3.xml.region_client import RegionClientXML
-from tempest.services.identity.v3.xml.service_client import \
- ServiceClientXML
-from tempest.services.identity.xml.identity_client import IdentityClientXML
-from tempest.services.identity.xml.identity_client import TokenClientXML
from tempest.services.image.v1.json.image_client import ImageClientJSON
from tempest.services.image.v2.json.image_client import ImageClientV2JSON
from tempest.services.messaging.json.messaging_client import \
MessagingClientJSON
from tempest.services.network.json.network_client import NetworkClientJSON
-from tempest.services.network.xml.network_client import NetworkClientXML
from tempest.services.object_storage.account_client import AccountClient
from tempest.services.object_storage.account_client import \
AccountClientCustomizedHeader
@@ -163,8 +120,6 @@
OrchestrationClient
from tempest.services.telemetry.json.telemetry_client import \
TelemetryClientJSON
-from tempest.services.telemetry.xml.telemetry_client import \
- TelemetryClientXML
from tempest.services.volume.json.admin.volume_hosts_client import \
VolumeHostsClientJSON
from tempest.services.volume.json.admin.volume_quotas_client import \
@@ -194,28 +149,6 @@
from tempest.services.volume.v2.json.snapshots_client import \
SnapshotsV2ClientJSON
from tempest.services.volume.v2.json.volumes_client import VolumesV2ClientJSON
-from tempest.services.volume.v2.xml.availability_zone_client import \
- VolumeV2AvailabilityZoneClientXML
-from tempest.services.volume.v2.xml.extensions_client import \
- ExtensionsV2ClientXML as VolumeV2ExtensionClientXML
-from tempest.services.volume.v2.xml.snapshots_client import \
- SnapshotsV2ClientXML
-from tempest.services.volume.v2.xml.volumes_client import VolumesV2ClientXML
-from tempest.services.volume.xml.admin.volume_hosts_client import \
- VolumeHostsClientXML
-from tempest.services.volume.xml.admin.volume_quotas_client import \
- VolumeQuotasClientXML
-from tempest.services.volume.xml.admin.volume_services_client import \
- VolumesServicesClientXML
-from tempest.services.volume.xml.admin.volume_types_client import \
- VolumeTypesClientXML
-from tempest.services.volume.xml.availability_zone_client import \
- VolumeAvailabilityZoneClientXML
-from tempest.services.volume.xml.backups_client import BackupsClientXML
-from tempest.services.volume.xml.extensions_client import \
- ExtensionsClientXML as VolumeExtensionClientXML
-from tempest.services.volume.xml.snapshots_client import SnapshotsClientXML
-from tempest.services.volume.xml.volumes_client import VolumesClientXML
CONF = config.CONF
LOG = logging.getLogger(__name__)
@@ -237,30 +170,19 @@
self._set_identity_clients(self.interface)
self._set_volume_clients(self.interface)
- if self.interface == 'xml':
- self.network_client = NetworkClientXML(self.auth_provider)
- if CONF.service_available.ceilometer:
- self.telemetry_client = TelemetryClientXML(
- self.auth_provider)
-
- elif self.interface == 'json':
- self.baremetal_client = BaremetalClientJSON(self.auth_provider)
- self.network_client = NetworkClientJSON(self.auth_provider)
- self.database_flavors_client = DatabaseFlavorsClientJSON(
+ self.baremetal_client = BaremetalClientJSON(self.auth_provider)
+ self.network_client = NetworkClientJSON(self.auth_provider)
+ self.database_flavors_client = DatabaseFlavorsClientJSON(
+ self.auth_provider)
+ self.database_versions_client = DatabaseVersionsClientJSON(
+ self.auth_provider)
+ self.messaging_client = MessagingClientJSON(self.auth_provider)
+ if CONF.service_available.ceilometer:
+ self.telemetry_client = TelemetryClientJSON(
self.auth_provider)
- self.database_versions_client = DatabaseVersionsClientJSON(
- self.auth_provider)
- self.messaging_client = MessagingClientJSON(self.auth_provider)
- if CONF.service_available.ceilometer:
- self.telemetry_client = TelemetryClientJSON(
- self.auth_provider)
- self.negative_client = rest_client.NegativeRestClient(
- self.auth_provider)
- self.negative_client.service = service
-
- else:
- msg = "Unsupported interface type `%s'" % interface
- raise exceptions.InvalidConfiguration(msg)
+ self.negative_client = rest_client.NegativeRestClient(
+ self.auth_provider)
+ self.negative_client.service = service
# TODO(andreaf) EC2 client still do their auth, v2 only
ec2_client_args = (self.credentials.username,
@@ -287,10 +209,7 @@
self.auth_provider)
def _set_compute_clients(self, type):
- if type == 'json':
- self._set_compute_json_clients()
- else:
- self._set_compute_xml_clients()
+ self._set_compute_json_clients()
# Common compute clients
self.agents_client = AgentsClientJSON(self.auth_provider)
@@ -299,33 +218,6 @@
self.security_group_default_rules_client = (
SecurityGroupDefaultRulesClientJSON(self.auth_provider))
- def _set_compute_xml_clients(self):
- self.certificates_client = CertificatesClientXML(self.auth_provider)
- self.servers_client = ServersClientXML(self.auth_provider)
- self.limits_client = LimitsClientXML(self.auth_provider)
- self.images_client = ImagesClientXML(self.auth_provider)
- self.keypairs_client = KeyPairsClientXML(self.auth_provider)
- self.quotas_client = QuotasClientXML(self.auth_provider)
- self.quota_classes_client = QuotaClassesClientXML(self.auth_provider)
- self.flavors_client = FlavorsClientXML(self.auth_provider)
- self.extensions_client = ExtensionsClientXML(self.auth_provider)
- self.volumes_extensions_client = VolumesExtensionsClientXML(
- self.auth_provider)
- self.floating_ips_client = FloatingIPsClientXML(self.auth_provider)
- self.security_groups_client = SecurityGroupsClientXML(
- self.auth_provider)
- self.interfaces_client = InterfacesClientXML(self.auth_provider)
- self.fixed_ips_client = FixedIPsClientXML(self.auth_provider)
- self.availability_zone_client = AvailabilityZoneClientXML(
- self.auth_provider)
- self.aggregates_client = AggregatesClientXML(self.auth_provider)
- self.services_client = ServicesClientXML(self.auth_provider)
- self.tenant_usages_client = TenantUsagesClientXML(self.auth_provider)
- self.hosts_client = HostsClientXML(self.auth_provider)
- self.hypervisor_client = HypervisorClientXML(self.auth_provider)
- self.instance_usages_audit_log_client = \
- InstanceUsagesAuditLogClientXML(self.auth_provider)
-
def _set_compute_json_clients(self):
self.certificates_client = CertificatesClientJSON(self.auth_provider)
self.certificates_v3_client = CertificatesV3ClientJSON(
@@ -371,22 +263,7 @@
InstanceUsagesAuditLogClientJSON(self.auth_provider)
def _set_identity_clients(self, type):
- if type == 'json':
- self._set_identity_json_clients()
- else:
- self._set_identity_xml_clients()
-
- def _set_identity_xml_clients(self):
- self.identity_client = IdentityClientXML(self.auth_provider)
- self.identity_v3_client = IdentityV3ClientXML(self.auth_provider)
- self.endpoints_client = EndPointClientXML(self.auth_provider)
- self.service_client = ServiceClientXML(self.auth_provider)
- self.policy_client = PolicyClientXML(self.auth_provider)
- self.region_client = RegionClientXML(self.auth_provider)
- self.token_client = TokenClientXML()
- if CONF.identity_feature_enabled.api_v3:
- self.token_v3_client = V3TokenClientXML()
- self.credentials_client = CredentialsClientXML(self.auth_provider)
+ self._set_identity_json_clients()
def _set_identity_json_clients(self):
self.identity_client = IdentityClientJSON(self.auth_provider)
@@ -401,11 +278,7 @@
self.credentials_client = CredentialsClientJSON(self.auth_provider)
def _set_volume_clients(self, type):
- if type == 'json':
- self._set_volume_json_clients()
- else:
- self._set_volume_xml_clients()
-
+ self._set_volume_json_clients()
# Common volume clients
# NOTE : As XML clients are not implemented for Qos-specs.
# So, setting the qos_client here. Once client are implemented,
@@ -415,26 +288,6 @@
self.volume_qos_v2_client = QosSpecsV2ClientJSON(
self.auth_provider)
- def _set_volume_xml_clients(self):
- self.backups_client = BackupsClientXML(self.auth_provider)
- self.snapshots_client = SnapshotsClientXML(self.auth_provider)
- self.snapshots_v2_client = SnapshotsV2ClientXML(self.auth_provider)
- self.volumes_client = VolumesClientXML(self.auth_provider)
- self.volumes_v2_client = VolumesV2ClientXML(self.auth_provider)
- self.volume_types_client = VolumeTypesClientXML(self.auth_provider)
- self.volume_services_client = VolumesServicesClientXML(
- self.auth_provider)
- self.volume_hosts_client = VolumeHostsClientXML(self.auth_provider)
- self.volume_quotas_client = VolumeQuotasClientXML(self.auth_provider)
- self.volumes_extension_client = VolumeExtensionClientXML(
- self.auth_provider)
- self.volumes_v2_extension_client = VolumeV2ExtensionClientXML(
- self.auth_provider)
- self.volume_availability_zone_client = \
- VolumeAvailabilityZoneClientXML(self.auth_provider)
- self.volume_v2_availability_zone_client = \
- VolumeV2AvailabilityZoneClientXML(self.auth_provider)
-
def _set_volume_json_clients(self):
self.backups_client = BackupsClientJSON(self.auth_provider)
self.backups_v2_client = BackupsClientV2JSON(self.auth_provider)
diff --git a/tempest/tests/test_tenant_isolation.py b/tempest/tests/test_tenant_isolation.py
index 27c45c2..df9719b 100644
--- a/tempest/tests/test_tenant_isolation.py
+++ b/tempest/tests/test_tenant_isolation.py
@@ -21,9 +21,7 @@
from tempest import exceptions
from tempest.openstack.common.fixture import mockpatch
from tempest.services.identity.json import identity_client as json_iden_client
-from tempest.services.identity.xml import identity_client as xml_iden_client
from tempest.services.network.json import network_client as json_network_client
-from tempest.services.network.xml import network_client as xml_network_client
from tempest.tests import base
from tempest.tests import fake_config
from tempest.tests import fake_http
@@ -49,14 +47,6 @@
self.assertTrue(isinstance(iso_creds.network_admin_client,
json_network_client.NetworkClientJSON))
- def test_tempest_client_xml(self):
- iso_creds = isolated_creds.IsolatedCreds('test class', interface='xml')
- self.assertEqual(iso_creds.interface, 'xml')
- self.assertTrue(isinstance(iso_creds.identity_admin_client,
- xml_iden_client.IdentityClientXML))
- self.assertTrue(isinstance(iso_creds.network_admin_client,
- xml_network_client.NetworkClientXML))
-
def _mock_user_create(self, id, name):
user_fix = self.useFixture(mockpatch.PatchObject(
json_iden_client.IdentityClientJSON,