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_lib.num_nets_provisioned(tenant_id) + db_lib.num_vms_provisioned(tenant_id)) if not objects_for_tenant: db_lib.forget_tenant(tenant_id)
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_lib.num_nets_provisioned(tenant_id) + db_lib.num_vms_provisioned(tenant_id) if not objects_for_tenant: db_lib.forget_tenant(tenant_id) try: self.rpc.delete_tenant(tenant_id) except arista_exc.AristaRpcError: LOG.info(EOS_UNREACHABLE_MSG) raise ml2_exc.MechanismDriverError()
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_lib.num_nets_provisioned(tenant_id) + db_lib.num_vms_provisioned(tenant_id)) if not objects_for_tenant: db_lib.forget_tenant(tenant_id) try: self.rpc.delete_tenant(tenant_id) except arista_exc.AristaRpcError: LOG.info(EOS_UNREACHABLE_MSG) raise ml2_exc.MechanismDriverError()