Skip to content

Commit

Permalink
ovn: Add schema versions and checksum to schema files.
Browse files Browse the repository at this point in the history
Signed-off-by: Gurucharan Shetty <[email protected]>
Acked-by: Ben Pfaff <[email protected]>
  • Loading branch information
shettyg committed Oct 2, 2015
1 parent fd1ed8d commit 5935835
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions ovn/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
/ovn-sb.5
/ovn-sb.gv
/ovn-sb.pic
/*.ovsschema.stamp
28 changes: 28 additions & 0 deletions ovn/automake.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions ovn/ovn-nb.ovsschema
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"name": "OVN_Northbound",
"version": "1.0.0",
"cksum": "3052542625 4535",
"tables": {
"Logical_Switch": {
"columns": {
Expand Down
2 changes: 2 additions & 0 deletions ovn/ovn-sb.ovsschema
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"name": "OVN_Southbound",
"version": "1.0.0",
"cksum": "4202564645 5078",
"tables": {
"Chassis": {
"columns": {
Expand Down

0 comments on commit 5935835

Please sign in to comment.