Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:chajain:branches:Cloud:Openstack:Master
openstack-tempest
0001-Remove-deprecated-services-from-cleanup.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-Remove-deprecated-services-from-cleanup.patch of Package openstack-tempest
From b091209db7ac965a26846ac3b8a4327ce01ef095 Mon Sep 17 00:00:00 2001 From: Martin Kopec <mkopec@redhat.com> Date: Tue, 12 Feb 2019 16:47:27 +0000 Subject: [PATCH 1/3] Remove deprecated services from cleanup The patch removes deprecated services from cleanup_service.py: * NetworkVipService * NetworkMemberService * NetworkHealthMonitorService * NetworkPoolService * FloatingIpService * SecurityGroupService The above services are not used by the cleanup tool, they call clients which were already removed from Tempest or the clients are marked as deprecated ones. Change-Id: I55ddbce64404c67688600dc6b1231d0bd8ff7006 Related-Bug: #1812660 --- tempest/cmd/cleanup_service.py | 156 ----------------------------------------- 1 file changed, 156 deletions(-) diff --git a/tempest/cmd/cleanup_service.py b/tempest/cmd/cleanup_service.py index 83cf42cc4..58cff63bf 100644 --- a/tempest/cmd/cleanup_service.py +++ b/tempest/cmd/cleanup_service.py @@ -236,57 +236,6 @@ class KeyPairService(BaseService): self.data['keypairs'] = keypairs -class SecurityGroupService(BaseService): - def __init__(self, manager, **kwargs): - super(SecurityGroupService, self).__init__(kwargs) - self.client = manager.compute_security_groups_client - - def list(self): - client = self.client - secgrps = client.list_security_groups()['security_groups'] - secgrp_del = [grp for grp in secgrps if grp['name'] != 'default'] - LOG.debug("List count, %s Security Groups", len(secgrp_del)) - return secgrp_del - - def delete(self): - client = self.client - secgrp_del = self.list() - for g in secgrp_del: - try: - client.delete_security_group(g['id']) - except Exception: - LOG.exception("Delete Security Groups exception.") - - def dry_run(self): - secgrp_del = self.list() - self.data['security_groups'] = secgrp_del - - -class FloatingIpService(BaseService): - def __init__(self, manager, **kwargs): - super(FloatingIpService, self).__init__(kwargs) - self.client = manager.compute_floating_ips_client - - def list(self): - client = self.client - floating_ips = client.list_floating_ips()['floating_ips'] - LOG.debug("List count, %s Floating IPs", len(floating_ips)) - return floating_ips - - def delete(self): - client = self.client - floating_ips = self.list() - for f in floating_ips: - try: - client.delete_floating_ip(f['id']) - except Exception: - LOG.exception("Delete Floating IPs exception.") - - def dry_run(self): - floating_ips = self.list() - self.data['floating_ips'] = floating_ips - - class VolumeService(BaseService): def __init__(self, manager, **kwargs): super(VolumeService, self).__init__(kwargs) @@ -451,102 +400,6 @@ class NetworkRouterService(NetworkService): self.data['routers'] = routers -class NetworkHealthMonitorService(NetworkService): - - def list(self): - client = self.client - hms = client.list_health_monitors() - hms = hms['health_monitors'] - hms = self._filter_by_tenant_id(hms) - LOG.debug("List count, %s Health Monitors", len(hms)) - return hms - - def delete(self): - client = self.client - hms = self.list() - for hm in hms: - try: - client.delete_health_monitor(hm['id']) - except Exception: - LOG.exception("Delete Health Monitor exception.") - - def dry_run(self): - hms = self.list() - self.data['health_monitors'] = hms - - -class NetworkMemberService(NetworkService): - - def list(self): - client = self.client - members = client.list_members() - members = members['members'] - members = self._filter_by_tenant_id(members) - LOG.debug("List count, %s Members", len(members)) - return members - - def delete(self): - client = self.client - members = self.list() - for member in members: - try: - client.delete_member(member['id']) - except Exception: - LOG.exception("Delete Member exception.") - - def dry_run(self): - members = self.list() - self.data['members'] = members - - -class NetworkVipService(NetworkService): - - def list(self): - client = self.client - vips = client.list_vips() - vips = vips['vips'] - vips = self._filter_by_tenant_id(vips) - LOG.debug("List count, %s VIPs", len(vips)) - return vips - - def delete(self): - client = self.client - vips = self.list() - for vip in vips: - try: - client.delete_vip(vip['id']) - except Exception: - LOG.exception("Delete VIP exception.") - - def dry_run(self): - vips = self.list() - self.data['vips'] = vips - - -class NetworkPoolService(NetworkService): - - def list(self): - client = self.client - pools = client.list_pools() - pools = pools['pools'] - pools = self._filter_by_tenant_id(pools) - LOG.debug("List count, %s Pools", len(pools)) - return pools - - def delete(self): - client = self.client - pools = self.list() - for pool in pools: - try: - client.delete_pool(pool['id']) - except Exception: - LOG.exception("Delete Pool exception.") - - def dry_run(self): - pools = self.list() - self.data['pools'] = pools - - class NetworkMeteringLabelRuleService(NetworkService): def list(self): @@ -754,12 +607,6 @@ class ImageService(BaseService): self.data['images'][image['id']] = image['name'] -class IdentityService(BaseService): - def __init__(self, manager, **kwargs): - super(IdentityService, self).__init__(kwargs) - self.client = manager.identity_v3_client - - class UserService(BaseService): def __init__(self, manager, **kwargs): @@ -929,10 +776,7 @@ def get_project_cleanup_services(): if IS_NOVA: project_services.append(ServerService) project_services.append(KeyPairService) - project_services.append(SecurityGroupService) project_services.append(ServerGroupService) - if not IS_NEUTRON: - project_services.append(FloatingIpService) project_services.append(NovaQuotaService) if IS_NEUTRON: project_services.append(NetworkFloatingIpService) -- 2.16.4
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor