From patchwork Thu Oct 1 22:09:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gurucharan Shetty X-Patchwork-Id: 525325 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (unknown [IPv6:2600:3c00::f03c:91ff:fe6e:bdf7]) by ozlabs.org (Postfix) with ESMTP id 06344140D69 for ; Fri, 2 Oct 2015 08:20:18 +1000 (AEST) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 11E1910D60; Thu, 1 Oct 2015 15:20:18 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx3v1.cudamail.com (mx3.cudamail.com [64.34.241.5]) by archives.nicira.com (Postfix) with ESMTPS id 2B64310D5E for ; Thu, 1 Oct 2015 15:20:17 -0700 (PDT) Received: from bar3.cudamail.com (bar1 [192.168.15.1]) by mx3v1.cudamail.com (Postfix) with ESMTP id AB0376184AA for ; Thu, 1 Oct 2015 16:20:16 -0600 (MDT) X-ASG-Debug-ID: 1443738016-03dd7b01f3149d0001-byXFYA Received: from mx3-pf2.cudamail.com ([192.168.14.1]) by bar3.cudamail.com with ESMTP id GEmTT3q7jQ2klOFH (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 01 Oct 2015 16:20:16 -0600 (MDT) X-Barracuda-Envelope-From: shettyg@nicira.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.14.1 Received: from unknown (HELO mail-wi0-f181.google.com) (209.85.212.181) by mx3-pf2.cudamail.com with ESMTPS (RC4-SHA encrypted); 1 Oct 2015 22:20:14 -0000 Received-SPF: unknown (mx3-pf2.cudamail.com: Multiple SPF records returned) X-Barracuda-Apparent-Source-IP: 209.85.212.181 X-Barracuda-RBL-IP: 209.85.212.181 Received: by wicfx3 with SMTP id fx3so8507074wic.0 for ; Thu, 01 Oct 2015 15:20:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=Z9EX9Zb0JOCzQMtLNyp1UvvKcqLHDHmijtyGzPFIlig=; b=m6uvKWOeFYgkBGq0LzlctBokVMKnZ4LCJ0V8Rseqvkrc2kz+4TueU/DozE+FWQTVOt eZr1ysDiFmAbyou4HSr+r/Rk/VRuTJvnZeDc3uKgasTRQENhPGGIG+i/1Lqiiz1ivm9y TJL3dNsLVIMohld+sbjSoGLQEOxHOcoGEFuN51qf+4LU5Ncmq7HsUWziAnUk1vx45s1s K29bm5a948VkYfUgysLJdraPmnSDiF0ZtGw+fyKdVoo7JsUoEIJhL3tpEU60eKWrHhML PbwV5p4zfSwm7kDGBUhwZm8VJHk3ctUWNHIne+TY75Y5eNg5035G5dy5VtsS9RZoMUlu JStA== X-Gm-Message-State: ALoCoQkHXtCZ4/0Qdh0KlE+3UlvZPgzeJNzUNOU9denWWCJ7wldAbp91kg7lQ1YjTm8tYExHvBLn X-Received: by 10.180.8.132 with SMTP id r4mr1083736wia.70.1443738012560; Thu, 01 Oct 2015 15:20:12 -0700 (PDT) Received: from htb-1n-eng-dhcp378.eng.vmware.com ([208.91.1.34]) by smtp.gmail.com with ESMTPSA id o3sm5269575wif.22.2015.10.01.15.20.11 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 01 Oct 2015 15:20:11 -0700 (PDT) X-CudaMail-Envelope-Sender: shettyg@nicira.com From: Gurucharan Shetty X-Google-Original-From: Gurucharan Shetty To: dev@openvswitch.org X-CudaMail-Whitelist-To: dev@openvswitch.org X-CudaMail-MID: CM-V2-930069864 X-CudaMail-DTE: 100115 X-CudaMail-Originating-IP: 209.85.212.181 Date: Thu, 1 Oct 2015 15:09:53 -0700 X-ASG-Orig-Subj: [##CM-V2-930069864##][PATCH 1/4] ovn: Add schema versions and checksum to schema files. Message-Id: <1443737396-2585-1-git-send-email-gshetty@nicira.com> X-Mailer: git-send-email 1.9.1 X-Barracuda-Connect: UNKNOWN[192.168.14.1] X-Barracuda-Start-Time: 1443738016 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-ASG-Whitelist: Header =?UTF-8?B?eFwtY3VkYW1haWxcLXdoaXRlbGlzdFwtdG8=?= X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 Subject: [ovs-dev] [PATCH 1/4] ovn: Add schema versions and checksum to schema files. X-BeenThere: dev@openvswitch.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dev-bounces@openvswitch.org Sender: "dev" Signed-off-by: Gurucharan Shetty Acked-by: Ben Pfaff --- ovn/.gitignore | 1 + ovn/automake.mk | 28 ++++++++++++++++++++++++++++ ovn/ovn-nb.ovsschema | 2 ++ ovn/ovn-sb.ovsschema | 2 ++ 4 files changed, 33 insertions(+) diff --git a/ovn/.gitignore b/ovn/.gitignore index 5b3bc55..d971938 100644 --- a/ovn/.gitignore +++ b/ovn/.gitignore @@ -5,3 +5,4 @@ /ovn-sb.5 /ovn-sb.gv /ovn-sb.pic +/*.ovsschema.stamp diff --git a/ovn/automake.mk b/ovn/automake.mk index 33bbd05..4b6a836 100644 --- a/ovn/automake.mk +++ b/ovn/automake.mk @@ -75,6 +75,34 @@ EXTRA_DIST += \ ovn/CONTAINERS.OpenStack.md \ ovn/OVN-GW-HA.md +# Version checking for ovn-nb.ovsschema. +ALL_LOCAL += ovn/ovn-nb.ovsschema.stamp +ovn/ovn-nb.ovsschema.stamp: ovn/ovn-nb.ovsschema + @sum=`sed '/cksum/d' $? | cksum`; \ + expected=`sed -n 's/.*"cksum": "\(.*\)".*/\1/p' $?`; \ + if test "X$$sum" = "X$$expected"; then \ + touch $@; \ + else \ + ln=`sed -n '/"cksum":/=' $?`; \ + echo >&2 "$?:$$ln: The checksum \"$$sum\" was calculated from the schema file and does not match cksum field in the schema file - you should probably update the version number and the checksum in the schema file with the value listed here."; \ + exit 1; \ + fi +CLEANFILES += ovn/ovn-nb.ovsschema.stamp + +# Version checking for ovn-sb.ovsschema. +ALL_LOCAL += ovn/ovn-sb.ovsschema.stamp +ovn/ovn-sb.ovsschema.stamp: ovn/ovn-sb.ovsschema + @sum=`sed '/cksum/d' $? | cksum`; \ + expected=`sed -n 's/.*"cksum": "\(.*\)".*/\1/p' $?`; \ + if test "X$$sum" = "X$$expected"; then \ + touch $@; \ + else \ + ln=`sed -n '/"cksum":/=' $?`; \ + echo >&2 "$?:$$ln: The checksum \"$$sum\" was calculated from the schema file and does not match cksum field in the schema file - you should probably update the version number and the checksum in the schema file with the value listed here."; \ + exit 1; \ + fi +CLEANFILES += ovn/ovn-sb.ovsschema.stamp + include ovn/controller/automake.mk include ovn/controller-vtep/automake.mk include ovn/lib/automake.mk diff --git a/ovn/ovn-nb.ovsschema b/ovn/ovn-nb.ovsschema index 566617b..780fe33 100644 --- a/ovn/ovn-nb.ovsschema +++ b/ovn/ovn-nb.ovsschema @@ -1,5 +1,7 @@ { "name": "OVN_Northbound", + "version": "1.0.0", + "cksum": "3052542625 4535", "tables": { "Logical_Switch": { "columns": { diff --git a/ovn/ovn-sb.ovsschema b/ovn/ovn-sb.ovsschema index 7f857ed..264a217 100644 --- a/ovn/ovn-sb.ovsschema +++ b/ovn/ovn-sb.ovsschema @@ -1,5 +1,7 @@ { "name": "OVN_Southbound", + "version": "1.0.0", + "cksum": "4202564645 5078", "tables": { "Chassis": { "columns": {