ovs.db.data: Make Datum.check_constraints() work.
[openvswitch] / python / ovs / db / data.py
index f62a562d08bbb03852cf4090c8caa04567c588b3..c07d8bfd59cd829ccdc7d03c7e097d373a8b3df2 100644 (file)
@@ -264,10 +264,10 @@ class Datum(object):
         This function is not commonly useful because the most ordinary way to
         obtain a datum is ultimately via Datum.from_json() or Atom.from_json(),
         which check constraints themselves."""
-        for keyAtom, valueAtom in self.values:
-            keyAtom.check_constraints()
+        for keyAtom, valueAtom in self.values.iteritems():
+            keyAtom.check_constraints(self.type.key)
             if valueAtom is not None:
-                valueAtom.check_constraints()
+                valueAtom.check_constraints(self.type.value)
 
     @staticmethod
     def from_json(type_, json, symtab=None):