[ovs-dev] [python idl 09/16] ovs.db.data: Make Datum.check_constraints() work.

Ethan Jackson ethan at nicira.com
Mon Sep 19 17:50:00 PDT 2011


Looks good,

Ethan

On Mon, Sep 19, 2011 at 11:18, Ben Pfaff <blp at nicira.com> wrote:
> This code never got tested and so didn't work.
>
> This does not fix an actual bug because Datum.check_constraints() does not
> have any existing users.
> ---
>  python/ovs/db/data.py |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/python/ovs/db/data.py b/python/ovs/db/data.py
> index f62a562..c07d8bf 100644
> --- a/python/ovs/db/data.py
> +++ b/python/ovs/db/data.py
> @@ -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):
> --
> 1.7.4.4
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
>



More information about the dev mailing list