def delete_tenant(self, tenant_id): """delete a tenant from DB. A tenant is deleted only if there is no network or VM configured configured for this tenant. """ objects_for_tenant = (db.num_nets_provisioned(tenant_id) + db.num_vms_provisioned(tenant_id)) if not objects_for_tenant: db.forget_tenant(tenant_id)