can anyone comment on this? best Tobi
On Do, 2015-02-12 at 20:01 +0100, Tobias Jungel wrote: > In case one of the kwargs is set to None the ofproto parsers for > versions 1.2, 1.3 and 1.4 fail. This patch skips k,v pairs having set v > to None. > > Signed-off-by: Tobias Jungel <[email protected]> > --- > ryu/ofproto/ofproto_v1_2_parser.py | 4 ++-- > ryu/ofproto/ofproto_v1_3_parser.py | 4 ++-- > ryu/ofproto/ofproto_v1_4_parser.py | 4 ++-- > 3 files changed, 6 insertions(+), 6 deletions(-) > > diff --git a/ryu/ofproto/ofproto_v1_2_parser.py > b/ryu/ofproto/ofproto_v1_2_parser.py > index 20f3b57..e96614a 100644 > --- a/ryu/ofproto/ofproto_v1_2_parser.py > +++ b/ryu/ofproto/ofproto_v1_2_parser.py > @@ -3395,9 +3395,9 @@ class OFPMatch(StringifyMixin): > # OFPMatch(eth_src=('ff:ff:ff:00:00:00'), eth_type=0x800, > # ipv4_src='10.0.0.1') > kwargs = dict(ofproto.oxm_normalize_user(k, v) for > - (k, v) in kwargs.iteritems()) > + (k, v) in kwargs.iteritems() if v is not None) > fields = [ofproto.oxm_from_user(k, v) for (k, v) > - in kwargs.iteritems()] > + in kwargs.iteritems() if v is not None] > # assumption: sorting by OXM type values makes fields > # meet ordering requirements (eg. eth_type before ipv4_src) > fields.sort() > diff --git a/ryu/ofproto/ofproto_v1_3_parser.py > b/ryu/ofproto/ofproto_v1_3_parser.py > index e9b4b29..5e35612 100644 > --- a/ryu/ofproto/ofproto_v1_3_parser.py > +++ b/ryu/ofproto/ofproto_v1_3_parser.py > @@ -828,9 +828,9 @@ class OFPMatch(StringifyMixin): > # OFPMatch(eth_src=('ff:ff:ff:00:00:00'), eth_type=0x800, > # ipv4_src='10.0.0.1') > kwargs = dict(ofproto.oxm_normalize_user(k, v) for > - (k, v) in kwargs.iteritems()) > + (k, v) in kwargs.iteritems() if v is not None) > fields = [ofproto.oxm_from_user(k, v) for (k, v) > - in kwargs.iteritems()] > + in kwargs.iteritems() if v is not None] > # assumption: sorting by OXM type values makes fields > # meet ordering requirements (eg. eth_type before ipv4_src) > fields.sort() > diff --git a/ryu/ofproto/ofproto_v1_4_parser.py > b/ryu/ofproto/ofproto_v1_4_parser.py > index 1363908..d61435b 100644 > --- a/ryu/ofproto/ofproto_v1_4_parser.py > +++ b/ryu/ofproto/ofproto_v1_4_parser.py > @@ -714,9 +714,9 @@ class OFPMatch(StringifyMixin): > self._fields2 = _ordered_fields > else: > kwargs = dict(ofproto.oxm_normalize_user(k, v) for > - (k, v) in kwargs.iteritems()) > + (k, v) in kwargs.iteritems() if v is not None) > fields = [ofproto.oxm_from_user(k, v) for (k, v) > - in kwargs.iteritems()] > + in kwargs.iteritems() if v is not None] > # assumption: sorting by OXM type values makes fields > # meet ordering requirements (eg. eth_type before ipv4_src) > fields.sort() ------------------------------------------------------------------------------ Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration & more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk _______________________________________________ Ryu-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ryu-devel
