-# Copyright (c) 2009, 2010, 2011 Nicira Networks
+# Copyright (c) 2009, 2010, 2011 Nicira, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
from ovs.db import error
import ovs.db.parser
-from ovs.db import types
+import ovs.db.types
def _check_id(name, json):
return DbSchema.from_json(self.to_json())
def __follow_ref_table(self, column, base, base_name):
- if not base or base.type != types.UuidType or not base.ref_table_name:
+ if (not base or base.type != ovs.db.types.UuidType
+ or not base.ref_table_name):
return
base.ref_table = self.tables.get(base.ref_table_name)
indexes_json = parser.get_optional("indexes", [list], [])
parser.finish()
- if max_rows == None:
+ if max_rows is None:
max_rows = sys.maxint
elif max_rows <= 0:
raise error.Error("maxRows must be at least 1", json)
differ from 'default_is_root'. Ordinarily 'default_is_root' should be
false, because ordinarily a table would be not be part of the root set
if its "isRoot" member is omitted. However, garbage collection was not
- orginally included in OVSDB, so in older schemas that do not include
+ originally included in OVSDB, so in older schemas that do not include
any "isRoot" members, every table is implicitly part of the root set.
To serialize such a schema in a way that can be read by older OVSDB
tools, specify 'default_is_root' as True.
parser = ovs.db.parser.Parser(json, "schema for column %s" % name)
mutable = parser.get_optional("mutable", [bool], True)
ephemeral = parser.get_optional("ephemeral", [bool], False)
- type_ = types.Type.from_json(parser.get("type", [dict, str, unicode]))
+ type_ = ovs.db.types.Type.from_json(parser.get("type",
+ [dict, str, unicode]))
parser.finish()
return ColumnSchema(name, mutable, not ephemeral, type_)