Improve logging in tempest cleanup
Add id or name of the resource which failed to delete to the logging. Change-Id: I04b04406e3917a63332199adf5c15b8e4ed6ca5a
This commit is contained in:
parent
db2fbc9268
commit
fd01fe9445
|
@ -158,7 +158,7 @@ class SnapshotService(BaseService):
|
||||||
try:
|
try:
|
||||||
client.delete_snapshot(snap['id'])
|
client.delete_snapshot(snap['id'])
|
||||||
except Exception:
|
except Exception:
|
||||||
LOG.exception("Delete Snapshot exception.")
|
LOG.exception("Delete Snapshot %s exception.", snap['id'])
|
||||||
|
|
||||||
def dry_run(self):
|
def dry_run(self):
|
||||||
snaps = self.list()
|
snaps = self.list()
|
||||||
|
@ -195,7 +195,7 @@ class ServerService(BaseService):
|
||||||
try:
|
try:
|
||||||
client.delete_server(server['id'])
|
client.delete_server(server['id'])
|
||||||
except Exception:
|
except Exception:
|
||||||
LOG.exception("Delete Server exception.")
|
LOG.exception("Delete Server %s exception.", server['id'])
|
||||||
|
|
||||||
def dry_run(self):
|
def dry_run(self):
|
||||||
servers = self.list()
|
servers = self.list()
|
||||||
|
@ -227,7 +227,7 @@ class ServerGroupService(ServerService):
|
||||||
try:
|
try:
|
||||||
client.delete_server_group(sg['id'])
|
client.delete_server_group(sg['id'])
|
||||||
except Exception:
|
except Exception:
|
||||||
LOG.exception("Delete Server Group exception.")
|
LOG.exception("Delete Server Group %s exception.", sg['id'])
|
||||||
|
|
||||||
def dry_run(self):
|
def dry_run(self):
|
||||||
sgs = self.list()
|
sgs = self.list()
|
||||||
|
@ -260,11 +260,11 @@ class KeyPairService(BaseService):
|
||||||
client = self.client
|
client = self.client
|
||||||
keypairs = self.list()
|
keypairs = self.list()
|
||||||
for k in keypairs:
|
for k in keypairs:
|
||||||
|
name = k['keypair']['name']
|
||||||
try:
|
try:
|
||||||
name = k['keypair']['name']
|
|
||||||
client.delete_keypair(name)
|
client.delete_keypair(name)
|
||||||
except Exception:
|
except Exception:
|
||||||
LOG.exception("Delete Keypairs exception.")
|
LOG.exception("Delete Keypair %s exception.", name)
|
||||||
|
|
||||||
def dry_run(self):
|
def dry_run(self):
|
||||||
keypairs = self.list()
|
keypairs = self.list()
|
||||||
|
@ -300,7 +300,7 @@ class VolumeService(BaseService):
|
||||||
try:
|
try:
|
||||||
client.delete_volume(v['id'])
|
client.delete_volume(v['id'])
|
||||||
except Exception:
|
except Exception:
|
||||||
LOG.exception("Delete Volume exception.")
|
LOG.exception("Delete Volume %s exception.", v['id'])
|
||||||
|
|
||||||
def dry_run(self):
|
def dry_run(self):
|
||||||
vols = self.list()
|
vols = self.list()
|
||||||
|
@ -323,7 +323,8 @@ class VolumeQuotaService(BaseService):
|
||||||
try:
|
try:
|
||||||
client.delete_quota_set(self.project_id)
|
client.delete_quota_set(self.project_id)
|
||||||
except Exception:
|
except Exception:
|
||||||
LOG.exception("Delete Volume Quotas exception.")
|
LOG.exception("Delete Volume Quotas exception for 'project %s'.",
|
||||||
|
self.project_id)
|
||||||
|
|
||||||
def dry_run(self):
|
def dry_run(self):
|
||||||
quotas = self.client.show_quota_set(
|
quotas = self.client.show_quota_set(
|
||||||
|
@ -342,7 +343,8 @@ class NovaQuotaService(BaseService):
|
||||||
try:
|
try:
|
||||||
client.delete_quota_set(self.project_id)
|
client.delete_quota_set(self.project_id)
|
||||||
except Exception:
|
except Exception:
|
||||||
LOG.exception("Delete Quotas exception.")
|
LOG.exception("Delete Quotas exception for 'project %s'.",
|
||||||
|
self.project_id)
|
||||||
|
|
||||||
def dry_run(self):
|
def dry_run(self):
|
||||||
client = self.limits_client
|
client = self.limits_client
|
||||||
|
@ -397,7 +399,7 @@ class NetworkService(BaseNetworkService):
|
||||||
try:
|
try:
|
||||||
client.delete_network(n['id'])
|
client.delete_network(n['id'])
|
||||||
except Exception:
|
except Exception:
|
||||||
LOG.exception("Delete Network exception.")
|
LOG.exception("Delete Network %s exception.", n['id'])
|
||||||
|
|
||||||
def dry_run(self):
|
def dry_run(self):
|
||||||
networks = self.list()
|
networks = self.list()
|
||||||
|
@ -431,7 +433,8 @@ class NetworkFloatingIpService(BaseNetworkService):
|
||||||
try:
|
try:
|
||||||
client.delete_floatingip(flip['id'])
|
client.delete_floatingip(flip['id'])
|
||||||
except Exception:
|
except Exception:
|
||||||
LOG.exception("Delete Network Floating IP exception.")
|
LOG.exception("Delete Network Floating IP %s exception.",
|
||||||
|
flip['id'])
|
||||||
|
|
||||||
def dry_run(self):
|
def dry_run(self):
|
||||||
flips = self.list()
|
flips = self.list()
|
||||||
|
@ -467,8 +470,8 @@ class NetworkRouterService(BaseNetworkService):
|
||||||
ports_client = self.ports_client
|
ports_client = self.ports_client
|
||||||
routers = self.list()
|
routers = self.list()
|
||||||
for router in routers:
|
for router in routers:
|
||||||
|
rid = router['id']
|
||||||
try:
|
try:
|
||||||
rid = router['id']
|
|
||||||
ports = [port for port
|
ports = [port for port
|
||||||
in ports_client.list_ports(device_id=rid)['ports']
|
in ports_client.list_ports(device_id=rid)['ports']
|
||||||
if net_info.is_router_interface_port(port)]
|
if net_info.is_router_interface_port(port)]
|
||||||
|
@ -476,7 +479,7 @@ class NetworkRouterService(BaseNetworkService):
|
||||||
client.remove_router_interface(rid, port_id=port['id'])
|
client.remove_router_interface(rid, port_id=port['id'])
|
||||||
client.delete_router(rid)
|
client.delete_router(rid)
|
||||||
except Exception:
|
except Exception:
|
||||||
LOG.exception("Delete Router exception.")
|
LOG.exception("Delete Router %s exception.", rid)
|
||||||
|
|
||||||
def dry_run(self):
|
def dry_run(self):
|
||||||
routers = self.list()
|
routers = self.list()
|
||||||
|
@ -511,7 +514,8 @@ class NetworkMeteringLabelRuleService(NetworkService):
|
||||||
try:
|
try:
|
||||||
client.delete_metering_label_rule(rule['id'])
|
client.delete_metering_label_rule(rule['id'])
|
||||||
except Exception:
|
except Exception:
|
||||||
LOG.exception("Delete Metering Label Rule exception.")
|
LOG.exception("Delete Metering Label Rule %s exception.",
|
||||||
|
rule['id'])
|
||||||
|
|
||||||
def dry_run(self):
|
def dry_run(self):
|
||||||
rules = self.list()
|
rules = self.list()
|
||||||
|
@ -546,7 +550,8 @@ class NetworkMeteringLabelService(BaseNetworkService):
|
||||||
try:
|
try:
|
||||||
client.delete_metering_label(label['id'])
|
client.delete_metering_label(label['id'])
|
||||||
except Exception:
|
except Exception:
|
||||||
LOG.exception("Delete Metering Label exception.")
|
LOG.exception("Delete Metering Label %s exception.",
|
||||||
|
label['id'])
|
||||||
|
|
||||||
def dry_run(self):
|
def dry_run(self):
|
||||||
labels = self.list()
|
labels = self.list()
|
||||||
|
@ -585,7 +590,7 @@ class NetworkPortService(BaseNetworkService):
|
||||||
try:
|
try:
|
||||||
client.delete_port(port['id'])
|
client.delete_port(port['id'])
|
||||||
except Exception:
|
except Exception:
|
||||||
LOG.exception("Delete Port exception.")
|
LOG.exception("Delete Port %s exception.", port['id'])
|
||||||
|
|
||||||
def dry_run(self):
|
def dry_run(self):
|
||||||
ports = self.list()
|
ports = self.list()
|
||||||
|
@ -626,7 +631,8 @@ class NetworkSecGroupService(BaseNetworkService):
|
||||||
try:
|
try:
|
||||||
client.delete_security_group(secgroup['id'])
|
client.delete_security_group(secgroup['id'])
|
||||||
except Exception:
|
except Exception:
|
||||||
LOG.exception("Delete security_group exception.")
|
LOG.exception("Delete security_group %s exception.",
|
||||||
|
secgroup['id'])
|
||||||
|
|
||||||
def dry_run(self):
|
def dry_run(self):
|
||||||
secgroups = self.list()
|
secgroups = self.list()
|
||||||
|
@ -661,7 +667,7 @@ class NetworkSubnetService(BaseNetworkService):
|
||||||
try:
|
try:
|
||||||
client.delete_subnet(subnet['id'])
|
client.delete_subnet(subnet['id'])
|
||||||
except Exception:
|
except Exception:
|
||||||
LOG.exception("Delete Subnet exception.")
|
LOG.exception("Delete Subnet %s exception.", subnet['id'])
|
||||||
|
|
||||||
def dry_run(self):
|
def dry_run(self):
|
||||||
subnets = self.list()
|
subnets = self.list()
|
||||||
|
@ -696,7 +702,7 @@ class NetworkSubnetPoolsService(BaseNetworkService):
|
||||||
try:
|
try:
|
||||||
client.delete_subnetpool(pool['id'])
|
client.delete_subnetpool(pool['id'])
|
||||||
except Exception:
|
except Exception:
|
||||||
LOG.exception("Delete Subnet Pool exception.")
|
LOG.exception("Delete Subnet Pool %s exception.", pool['id'])
|
||||||
|
|
||||||
def dry_run(self):
|
def dry_run(self):
|
||||||
pools = self.list()
|
pools = self.list()
|
||||||
|
@ -736,7 +742,7 @@ class FlavorService(BaseService):
|
||||||
try:
|
try:
|
||||||
client.delete_flavor(flavor['id'])
|
client.delete_flavor(flavor['id'])
|
||||||
except Exception:
|
except Exception:
|
||||||
LOG.exception("Delete Flavor exception.")
|
LOG.exception("Delete Flavor %s exception.", flavor['id'])
|
||||||
|
|
||||||
def dry_run(self):
|
def dry_run(self):
|
||||||
flavors = self.list()
|
flavors = self.list()
|
||||||
|
@ -773,7 +779,7 @@ class ImageService(BaseService):
|
||||||
try:
|
try:
|
||||||
client.delete_image(image['id'])
|
client.delete_image(image['id'])
|
||||||
except Exception:
|
except Exception:
|
||||||
LOG.exception("Delete Image exception.")
|
LOG.exception("Delete Image %s exception.", image['id'])
|
||||||
|
|
||||||
def dry_run(self):
|
def dry_run(self):
|
||||||
images = self.list()
|
images = self.list()
|
||||||
|
@ -816,7 +822,7 @@ class UserService(BaseService):
|
||||||
try:
|
try:
|
||||||
self.client.delete_user(user['id'])
|
self.client.delete_user(user['id'])
|
||||||
except Exception:
|
except Exception:
|
||||||
LOG.exception("Delete User exception.")
|
LOG.exception("Delete User %s exception.", user['id'])
|
||||||
|
|
||||||
def dry_run(self):
|
def dry_run(self):
|
||||||
users = self.list()
|
users = self.list()
|
||||||
|
@ -856,7 +862,7 @@ class RoleService(BaseService):
|
||||||
try:
|
try:
|
||||||
self.client.delete_role(role['id'])
|
self.client.delete_role(role['id'])
|
||||||
except Exception:
|
except Exception:
|
||||||
LOG.exception("Delete Role exception.")
|
LOG.exception("Delete Role %s exception.", role['id'])
|
||||||
|
|
||||||
def dry_run(self):
|
def dry_run(self):
|
||||||
roles = self.list()
|
roles = self.list()
|
||||||
|
@ -898,7 +904,7 @@ class ProjectService(BaseService):
|
||||||
try:
|
try:
|
||||||
self.client.delete_project(project['id'])
|
self.client.delete_project(project['id'])
|
||||||
except Exception:
|
except Exception:
|
||||||
LOG.exception("Delete project exception.")
|
LOG.exception("Delete project %s exception.", project['id'])
|
||||||
|
|
||||||
def dry_run(self):
|
def dry_run(self):
|
||||||
projects = self.list()
|
projects = self.list()
|
||||||
|
@ -935,7 +941,7 @@ class DomainService(BaseService):
|
||||||
client.update_domain(domain['id'], enabled=False)
|
client.update_domain(domain['id'], enabled=False)
|
||||||
client.delete_domain(domain['id'])
|
client.delete_domain(domain['id'])
|
||||||
except Exception:
|
except Exception:
|
||||||
LOG.exception("Delete Domain exception.")
|
LOG.exception("Delete Domain %s exception.", domain['id'])
|
||||||
|
|
||||||
def dry_run(self):
|
def dry_run(self):
|
||||||
domains = self.list()
|
domains = self.list()
|
||||||
|
|
Loading…
Reference in New Issue