At Wed, 24 May 2017 14:58:04 +0900, Iwase Yusuke wrote: > > Hi, > > > On 2017年05月23日 16:05, IWAMOTO Toshihiro wrote: > > diff --git a/ryu/lib/ofctl_string.py b/ryu/lib/ofctl_string.py > > ...(snip) > > + > > +import re > > + > > +import ryu.exception > > +from ryu.lib.ofctl_utils import str_to_int > > +from ryu.ofproto import nicira_ext > > + > > For pep8 happy, 2 blank lines expected here? > Done.
> > +def nxm_field_name_to_ryu(field): > > + """ > > + Convert an ovs-ofctl style NXM_/OXM_ field name to > > + a ryu match field name. > > + """ > > + prefix = field[:7] > > + field = field[7:].lower() > > + mapped_result = None > > + > > + # TODO: handle "_W" suffix. > > Stripping that suffix as following is not enough? > field = field.rstrip('_W') > prefix = field[:7] > field = field[7:].lower() > rstrip doesn't seem to work as expected. > > +class OfctlActionConverter(object): > > + > > ...(snip) > > + > > + # NX actions > > + @classmethod > > + def resubmit(cls, ofproto, action_str): > > + arg = action_str[len("resubmit"):] > > + kwargs = {} > > + try: > > + if arg[0] == ':': > > + kwargs['in_port'] = str_to_int(arg[1:]) > > + elif arg[0] == '(' and arg[-1] == ')': > > + in_port, table_id = arg[1:-1].split(',') > > + if in_port: > > + kwargs['in_port'] = str_to_int(in_port) > > + if table_id: > > + kwargs['table_id'] = str_to_int(table_id) > > + else: > > + raise Exception > > + return dict(NXActionResubmitTable=kwargs) > > + except Exception: > > + raise ryu.exception.OFPInvalidActionString( > > + action_str=action) > > "actions" is a typo of "action_str"? > Yes. Thanks for the review. -- IWAMOTO Toshihiro ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Ryu-devel mailing list Ryu-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ryu-devel