Implement initial Python bindings for Open vSwitch database.
[sliver-openvswitch.git] / ovsdb / ovsdb-dot.in
index 1793530..3a9d9b0 100755 (executable)
@@ -6,11 +6,6 @@ import os
 import re
 import sys
 
-sys.path.insert(0, "@abs_top_srcdir@/ovsdb")
-import simplejson as json
-
-from OVSDB import *
-
 argv0 = sys.argv[0]
 
 def printEdge(tableName, baseType, label):
@@ -25,7 +20,7 @@ def printEdge(tableName, baseType, label):
             ', '.join(['%s=%s' % (k,v) for k,v in options.items()]))
 
 def schemaToDot(schemaFile):
-    schema = DbSchema.fromJson(json.load(open(schemaFile, "r")))
+    schema = DbSchema.fromJson(ovs.json.from_file(schemaFile))
 
     print "digraph %s {" % schema.name
     for tableName, table in schema.tables.iteritems():