def on_put(self, req, resp, tenant_id): tenant = Tenant.get_tenant(tenant_id) if tenant: body = self.load_body(req) body['tenant_id'] = tenant_id tenant = Tenant.build_tenant_from_dict(body) Tenant.update_tenant(tenant) else: msg = 'Cannot find tenant: {tenant_id}'.format(tenant_id=tenant_id) resp.status = falcon.HTTP_404 resp.body = json.dumps({'description': msg})