Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1558025/?format=api
{ "id": 1558025, "url": "http://patchwork.ozlabs.org/api/patches/1558025/?format=api", "web_url": "http://patchwork.ozlabs.org/project/openvswitch/patch/20211122112256.2011194-11-amorenoz@redhat.com/", "project": { "id": 47, "url": "http://patchwork.ozlabs.org/api/projects/47/?format=api", "name": "Open vSwitch", "link_name": "openvswitch", "list_id": "ovs-dev.openvswitch.org", "list_email": "ovs-dev@openvswitch.org", "web_url": "http://openvswitch.org/", "scm_url": "git@github.com:openvswitch/ovs.git", "webscm_url": "https://github.com/openvswitch/ovs", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20211122112256.2011194-11-amorenoz@redhat.com>", "list_archive_url": null, "date": "2021-11-22T11:22:48", "name": "[ovs-dev,v1,10/18] python: add a json encoder to flow fields", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": false, "hash": "53f6a47c8b18fa15a55ed8fd87abad9dea27c3f5", "submitter": { "id": 77477, "url": "http://patchwork.ozlabs.org/api/people/77477/?format=api", "name": "Adrian Moreno", "email": "amorenoz@redhat.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/openvswitch/patch/20211122112256.2011194-11-amorenoz@redhat.com/mbox/", "series": [ { "id": 273222, "url": "http://patchwork.ozlabs.org/api/series/273222/?format=api", "web_url": "http://patchwork.ozlabs.org/project/openvswitch/list/?series=273222", "date": "2021-11-22T11:22:39", "name": "python: add flow parsing library", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/273222/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1558025/comments/", "check": "fail", "checks": "http://patchwork.ozlabs.org/api/patches/1558025/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<ovs-dev-bounces@openvswitch.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "dev@openvswitch.org" ], "Delivered-To": [ "patchwork-incoming@bilbo.ozlabs.org", "ovs-dev@lists.linuxfoundation.org" ], "Authentication-Results": [ "bilbo.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=PIslBU8Z;\n\tdkim-atps=neutral", "ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org\n (client-ip=140.211.166.138; helo=smtp1.osuosl.org;\n envelope-from=ovs-dev-bounces@openvswitch.org; receiver=<UNKNOWN>)", "smtp2.osuosl.org (amavisd-new);\n dkim=pass (1024-bit key) header.d=redhat.com", "relay.mimecast.com;\n auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=amorenoz@redhat.com" ], "Received": [ "from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest\n SHA256)\n\t(No client certificate requested)\n\tby bilbo.ozlabs.org (Postfix) with ESMTPS id 4HyQ075K2kz9sRR\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 22 Nov 2021 22:24:23 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby smtp1.osuosl.org (Postfix) with ESMTP id 9D80281CDC;\n\tMon, 22 Nov 2021 11:24:21 +0000 (UTC)", "from smtp1.osuosl.org ([127.0.0.1])\n\tby localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id WkNluu8PSfDa; Mon, 22 Nov 2021 11:24:20 +0000 (UTC)", "from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56])\n\tby smtp1.osuosl.org (Postfix) with ESMTPS id 3B8808100F;\n\tMon, 22 Nov 2021 11:24:19 +0000 (UTC)", "from lf-lists.osuosl.org (localhost [127.0.0.1])\n\tby lists.linuxfoundation.org (Postfix) with ESMTP id 51DF9C0044;\n\tMon, 22 Nov 2021 11:24:17 +0000 (UTC)", "from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n by lists.linuxfoundation.org (Postfix) with ESMTP id 15FFFC0044\n for <dev@openvswitch.org>; Mon, 22 Nov 2021 11:24:16 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n by smtp2.osuosl.org (Postfix) with ESMTP id 8668D403AB\n for <dev@openvswitch.org>; Mon, 22 Nov 2021 11:23:39 +0000 (UTC)", "from smtp2.osuosl.org ([127.0.0.1])\n by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n with ESMTP id y-Xx8KnbYV-s for <dev@openvswitch.org>;\n Mon, 22 Nov 2021 11:23:38 +0000 (UTC)", "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.133.124])\n by smtp2.osuosl.org (Postfix) with ESMTPS id C6B3340426\n for <dev@openvswitch.org>; Mon, 22 Nov 2021 11:23:38 +0000 (UTC)", "from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com\n [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n us-mta-230-pF0dDscDP_Se8T0LGCxO8w-1; Mon, 22 Nov 2021 06:23:34 -0500", "from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com\n [10.5.11.13])\n (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n (No client certificate requested)\n by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B300780668C\n for <dev@openvswitch.org>; Mon, 22 Nov 2021 11:23:33 +0000 (UTC)", "from amorenoz.users.ipa.redhat.com (unknown [10.2.16.196])\n by smtp.corp.redhat.com (Postfix) with ESMTP id DBF6A60862;\n Mon, 22 Nov 2021 11:23:32 +0000 (UTC)" ], "X-Virus-Scanned": [ "amavisd-new at osuosl.org", "amavisd-new at osuosl.org" ], "X-Greylist": "domain auto-whitelisted by SQLgrey-1.8.0", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1637580217;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=uwULzTBQfKjR6im6Ye2tkTQMevTWOvN8sJ9GCogvaJQ=;\n b=PIslBU8ZE5Deh/moHh3JMNdJo0YGpfms+fusahAc+ZLZuDSp2+G7F+7ieJpkPxprIg27f7\n BsjnHSxaoAa0khrWPpjlk6wAQ6cAiLZ7ArQjTnID2e1WKx4HawBRbD4Yrt6JH0DgQPshWD\n C0qigRDvxfob37li/UPNNn1GbQ8bsRs=", "X-MC-Unique": "pF0dDscDP_Se8T0LGCxO8w-1", "From": "Adrian Moreno <amorenoz@redhat.com>", "To": "dev@openvswitch.org", "Date": "Mon, 22 Nov 2021 12:22:48 +0100", "Message-Id": "<20211122112256.2011194-11-amorenoz@redhat.com>", "In-Reply-To": "<20211122112256.2011194-1-amorenoz@redhat.com>", "References": "<20211122112256.2011194-1-amorenoz@redhat.com>", "MIME-Version": "1.0", "X-Scanned-By": "MIMEDefang 2.79 on 10.5.11.13", "X-Mimecast-Spam-Score": "0", "X-Mimecast-Originator": "redhat.com", "Subject": "[ovs-dev] [PATCH v1 10/18] python: add a json encoder to flow fields", "X-BeenThere": "ovs-dev@openvswitch.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "<ovs-dev.openvswitch.org>", "List-Unsubscribe": "<https://mail.openvswitch.org/mailman/options/ovs-dev>,\n <mailto:ovs-dev-request@openvswitch.org?subject=unsubscribe>", "List-Archive": "<http://mail.openvswitch.org/pipermail/ovs-dev/>", "List-Post": "<mailto:ovs-dev@openvswitch.org>", "List-Help": "<mailto:ovs-dev-request@openvswitch.org?subject=help>", "List-Subscribe": "<https://mail.openvswitch.org/mailman/listinfo/ovs-dev>,\n <mailto:ovs-dev-request@openvswitch.org?subject=subscribe>", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Errors-To": "ovs-dev-bounces@openvswitch.org", "Sender": "\"dev\" <ovs-dev-bounces@openvswitch.org>" }, "content": "The json encoder can be used to convert Flows to json\n\nSigned-off-by: Adrian Moreno <amorenoz@redhat.com>\n---\n python/ovs/flows/decoders.py | 15 +++++++++++++++\n 1 file changed, 15 insertions(+)", "diff": "diff --git a/python/ovs/flows/decoders.py b/python/ovs/flows/decoders.py\nindex 3def9f279..96bb56c06 100644\n--- a/python/ovs/flows/decoders.py\n+++ b/python/ovs/flows/decoders.py\n@@ -5,6 +5,7 @@ A decoder is generally a callable that accepts a string and returns the value\n object.\n \"\"\"\n \n+import json\n import netaddr\n import re\n \n@@ -451,3 +452,17 @@ def decode_nat(value):\n result[flag] = True\n \n return result\n+\n+\n+class FlowEncoder(json.JSONEncoder):\n+ \"\"\"FlowEncoder is a json.JSONEncoder instance that can be used to\n+ serialize flow fields\n+ \"\"\"\n+\n+ def default(self, obj):\n+ if isinstance(obj, Decoder):\n+ return obj.to_json()\n+ elif isinstance(obj, netaddr.IPAddress):\n+ return str(obj)\n+\n+ return json.JSONEncoder.default(self, obj)\n", "prefixes": [ "ovs-dev", "v1", "10/18" ] }