summaryrefslogtreecommitdiff
path: root/python/ovs/db/data.py
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2011-08-24 11:57:14 -0700
committerBen Pfaff <blp@nicira.com>2011-08-24 11:57:14 -0700
commit57d6a4c71bd0b4ed477ec273d4d4f84c5e4ed465 (patch)
tree4c1854395866316c6c930a59bf8e5027dfdbfee7 /python/ovs/db/data.py
parent9601fa824d2c3968fda75204488e347d66d62d1f (diff)
downloadopenvswitch-57d6a4c71bd0b4ed477ec273d4d4f84c5e4ed465.tar.gz
ovs.db.data: Fix bugs in Atom.is_default() and Datum.is_default().
Reported-by: Reid Price <reid@nicira.com>
Diffstat (limited to 'python/ovs/db/data.py')
-rw-r--r--python/ovs/db/data.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/python/ovs/db/data.py b/python/ovs/db/data.py
index bfdc11cbc..ae8af2faa 100644
--- a/python/ovs/db/data.py
+++ b/python/ovs/db/data.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2009, 2010 Nicira Networks
+# Copyright (c) 2009, 2010, 2011 Nicira Networks
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -89,7 +89,7 @@ class Atom(object):
return Atom(type)
def is_default(self):
- return self == default(self.type)
+ return self == self.default(self.type)
@staticmethod
def from_json(base, json, symtab=None):
@@ -259,9 +259,8 @@ class Datum(object):
values = {type.key.default(): None}
return Datum(type, values)
- @staticmethod
def is_default(self):
- return self == default(self.type)
+ return self == Datum.default(self.type)
def check_constraints(self):
"""Checks that each of the atoms in 'datum' conforms to the constraints