Initial versions of commit
8cdf034974 "python: Implement write support in
Python IDL for OVSDB" converted the OVSDB schemas to Python code so that
their Python clients could just import them. The final version instead
read the schemas from a file, but I forgot to remove some code that
generated the Python schema modules. This commit removes that code.
Reported-by: Ethan Jackson <ethan@nicira.com>
ovsdb/ovsdb-idlc.in \
ovsdb/ovsdb-idlc.1
DISTCLEANFILES += ovsdb/ovsdb-idlc
ovsdb/ovsdb-idlc.in \
ovsdb/ovsdb-idlc.1
DISTCLEANFILES += ovsdb/ovsdb-idlc
-SUFFIXES += .ovsidl .ovsschema .py
+SUFFIXES += .ovsidl .ovsschema
OVSDB_IDLC = $(run_python) $(srcdir)/ovsdb/ovsdb-idlc.in
.ovsidl.c:
$(OVSDB_IDLC) c-idl-source $< > $@.tmp
OVSDB_IDLC = $(run_python) $(srcdir)/ovsdb/ovsdb-idlc.in
.ovsidl.c:
$(OVSDB_IDLC) c-idl-source $< > $@.tmp
.ovsidl.h:
$(OVSDB_IDLC) c-idl-header $< > $@.tmp
mv $@.tmp $@
.ovsidl.h:
$(OVSDB_IDLC) c-idl-header $< > $@.tmp
mv $@.tmp $@
-.ovsschema.py:
- $(OVSDB_IDLC) python-module $< > $@.tmp
- mv $@.tmp $@
EXTRA_DIST += $(OVSIDL_BUILT)
BUILT_SOURCES += $(OVSIDL_BUILT)
EXTRA_DIST += $(OVSIDL_BUILT)
BUILT_SOURCES += $(OVSIDL_BUILT)
print " %s_columns_init();" % structName
print "}"
print " %s_columns_init();" % structName
print "}"
-def print_python_module(schema_file):
- schema = ovs.db.schema.DbSchema.from_json(ovs.json.from_file(schema_file))
- print """\
-# Generated automatically -- do not modify! -*- buffer-read-only: t -*-
-
-import ovs.db.schema
-import ovs.json
-
-__schema_json = \"\"\"
-%s
-\"\"\"
-
-schema = ovs.db.schema.DbSchema.from_json(ovs.json.from_string(__schema_json))
-""" % ovs.json.to_string(schema.to_json(), pretty=True)
def ovsdb_escape(string):
def escape(match):
def ovsdb_escape(string):
def escape(match):
annotate SCHEMA ANNOTATIONS print SCHEMA combined with ANNOTATIONS
c-idl-header IDL print C header file for IDL
c-idl-source IDL print C source file for IDL implementation
annotate SCHEMA ANNOTATIONS print SCHEMA combined with ANNOTATIONS
c-idl-header IDL print C header file for IDL
c-idl-source IDL print C source file for IDL implementation
- python-module IDL print Python module for IDL
nroff IDL print schema documentation in nroff format
The following options are also available:
nroff IDL print schema documentation in nroff format
The following options are also available:
commands = {"annotate": (annotateSchema, 2),
"c-idl-header": (printCIDLHeader, 1),
commands = {"annotate": (annotateSchema, 2),
"c-idl-header": (printCIDLHeader, 1),
- "c-idl-source": (printCIDLSource, 1),
- "python-module": (print_python_module, 1)}
+ "c-idl-source": (printCIDLSource, 1)}
if not args[0] in commands:
sys.stderr.write("%s: unknown command \"%s\" "
if not args[0] in commands:
sys.stderr.write("%s: unknown command \"%s\" "
tests_test_ovsdb_LDADD = ovsdb/libovsdb.a lib/libopenvswitch.a $(SSL_LIBS)
# idltest schema and IDL
tests_test_ovsdb_LDADD = ovsdb/libovsdb.a lib/libopenvswitch.a $(SSL_LIBS)
# idltest schema and IDL
-OVSIDL_BUILT += \
- tests/idltest.c \
- tests/idltest.h \
- tests/idltest.ovsidl \
- tests/idltest.py
+OVSIDL_BUILT += tests/idltest.c tests/idltest.h tests/idltest.ovsidl
IDLTEST_IDL_FILES = tests/idltest.ovsschema tests/idltest.ann
EXTRA_DIST += $(IDLTEST_IDL_FILES)
IDLTEST_IDL_FILES = tests/idltest.ovsschema tests/idltest.ann
EXTRA_DIST += $(IDLTEST_IDL_FILES)
-CLEANFILES += tests/idltest.pyc tests/idltest.pyo
tests/idltest.ovsidl: $(IDLTEST_IDL_FILES)
$(OVSDB_IDLC) -C $(srcdir) annotate $(IDLTEST_IDL_FILES) > $@.tmp
mv $@.tmp $@
tests/idltest.c: tests/idltest.h
tests/idltest.ovsidl: $(IDLTEST_IDL_FILES)
$(OVSDB_IDLC) -C $(srcdir) annotate $(IDLTEST_IDL_FILES) > $@.tmp
mv $@.tmp $@
tests/idltest.c: tests/idltest.h
-noinst_SCRIPTS += tests/idltest.py
-
noinst_PROGRAMS += tests/test-reconnect
tests_test_reconnect_SOURCES = tests/test-reconnect.c
tests_test_reconnect_LDADD = lib/libopenvswitch.a
noinst_PROGRAMS += tests/test-reconnect
tests_test_reconnect_SOURCES = tests/test-reconnect.c
tests_test_reconnect_LDADD = lib/libopenvswitch.a