Use quotas/security_groups clients from tempest-lib
The files below have been migrated to tempest-lib * quotas_client.py : I559c7ec29d6cc85060d59b8b7714a669a277f217 * security_groups_client.py: I559c7ec29d6cc85060d59b8b7714a669a277f217 Now Tempest-lib provides those as stable interfaces. So Tempest should start using those from lib and remove its own copy. Change-Id: Ib97637566b5f48523b7b39899f0350fdf8f87a9e
This commit is contained in:
parent
c509a152c3
commit
b5ce7357f2
@ -81,6 +81,10 @@ from tempest_lib.services.network.metering_labels_client import \
|
||||
MeteringLabelsClient
|
||||
from tempest_lib.services.network.networks_client import NetworksClient
|
||||
from tempest_lib.services.network.ports_client import PortsClient
|
||||
from tempest_lib.services.network.quotas_client import QuotasClient \
|
||||
as NetworkQuotasClient
|
||||
from tempest_lib.services.network.security_groups_client import \
|
||||
SecurityGroupsClient
|
||||
from tempest_lib.services.network.subnets_client import SubnetsClient
|
||||
|
||||
from tempest.common import negative_rest_client
|
||||
@ -128,12 +132,8 @@ from tempest.services.image.v2.json.images_client import ImagesClientV2
|
||||
from tempest.services.messaging.json.messaging_client import \
|
||||
MessagingClient
|
||||
from tempest.services.network.json.network_client import NetworkClient
|
||||
from tempest.services.network.json.quotas_client import QuotasClient \
|
||||
as NetworkQuotasClient
|
||||
from tempest.services.network.json.security_group_rules_client import \
|
||||
SecurityGroupRulesClient
|
||||
from tempest.services.network.json.security_groups_client import \
|
||||
SecurityGroupsClient
|
||||
from tempest.services.network.json.subnetpools_client import SubnetpoolsClient
|
||||
from tempest.services.object_storage.account_client import AccountClient
|
||||
from tempest.services.object_storage.container_client import ContainerClient
|
||||
|
@ -1,2 +1 @@
|
||||
./tempest/services/baremetal/base.py
|
||||
./tempest/services/network/json/quotas_client.py
|
||||
|
@ -1,35 +0,0 @@
|
||||
# Copyright 2015 NEC Corporation. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from tempest.services.network.json import base
|
||||
|
||||
|
||||
class QuotasClient(base.BaseNetworkClient):
|
||||
|
||||
def update_quotas(self, tenant_id, **kwargs):
|
||||
put_body = {'quota': kwargs}
|
||||
uri = '/quotas/%s' % tenant_id
|
||||
return self.update_resource(uri, put_body)
|
||||
|
||||
def reset_quotas(self, tenant_id):
|
||||
uri = '/quotas/%s' % tenant_id
|
||||
return self.delete_resource(uri)
|
||||
|
||||
def show_quotas(self, tenant_id, **fields):
|
||||
uri = '/quotas/%s' % tenant_id
|
||||
return self.show_resource(uri, **fields)
|
||||
|
||||
def list_quotas(self, **filters):
|
||||
uri = '/quotas'
|
||||
return self.list_resources(uri, **filters)
|
@ -1,38 +0,0 @@
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from tempest.services.network.json import base
|
||||
|
||||
|
||||
class SecurityGroupsClient(base.BaseNetworkClient):
|
||||
|
||||
def create_security_group(self, **kwargs):
|
||||
uri = '/security-groups'
|
||||
post_data = {'security_group': kwargs}
|
||||
return self.create_resource(uri, post_data)
|
||||
|
||||
def update_security_group(self, security_group_id, **kwargs):
|
||||
uri = '/security-groups/%s' % security_group_id
|
||||
post_data = {'security_group': kwargs}
|
||||
return self.update_resource(uri, post_data)
|
||||
|
||||
def show_security_group(self, security_group_id, **fields):
|
||||
uri = '/security-groups/%s' % security_group_id
|
||||
return self.show_resource(uri, **fields)
|
||||
|
||||
def delete_security_group(self, security_group_id):
|
||||
uri = '/security-groups/%s' % security_group_id
|
||||
return self.delete_resource(uri)
|
||||
|
||||
def list_security_groups(self, **filters):
|
||||
uri = '/security-groups'
|
||||
return self.list_resources(uri, **filters)
|
@ -406,7 +406,7 @@ class TestDynamicCredentialProvider(base.TestCase):
|
||||
|
||||
return_values = (fake_http.fake_httplib({}, status=204), {})
|
||||
remove_secgroup_mock = self.patch(
|
||||
'tempest.services.network.json.security_groups_client.'
|
||||
'tempest_lib.services.network.security_groups_client.'
|
||||
'SecurityGroupsClient.delete', return_value=return_values)
|
||||
creds.clear_creds()
|
||||
# Verify default security group delete
|
||||
|
Loading…
Reference in New Issue
Block a user