when using action type below, the log unsuitable is outputted:
Unknown action type: [action type]

  * GOTO_TABLE, WRITE_METADATA, METER(only ofctl_v1_3.py)

this patch fixes this problem.

Reported-by: jalee <ja...@inno-tech.com.tw>
Signed-off-by: Minoru TAKAHASHI <takahashi.mino...@gmail.com>
---
 ryu/lib/ofctl_v1_2.py | 3 +--
 ryu/lib/ofctl_v1_3.py | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/ryu/lib/ofctl_v1_2.py b/ryu/lib/ofctl_v1_2.py
index a01acaf..0f767cd 100644
--- a/ryu/lib/ofctl_v1_2.py
+++ b/ryu/lib/ofctl_v1_2.py
@@ -47,7 +47,6 @@ def to_action(dp, dic):
     ofp = dp.ofproto
     parser = dp.ofproto_parser
 
-    result = None
     action_type = dic.get('type')
     if action_type == 'OUTPUT':
         out_port = int(dic.get('port', ofp.OFPP_ANY))
@@ -89,7 +88,7 @@ def to_action(dp, dic):
         value = dic.get('value')
         result = parser.OFPActionSetField(**{field: value})
     else:
-        LOG.debug('Unknown action type: %s' % action_type)
+        result = None
 
     return result
 
diff --git a/ryu/lib/ofctl_v1_3.py b/ryu/lib/ofctl_v1_3.py
index 4a27031..b81a8ee 100644
--- a/ryu/lib/ofctl_v1_3.py
+++ b/ryu/lib/ofctl_v1_3.py
@@ -47,7 +47,6 @@ def to_action(dp, dic):
     ofp = dp.ofproto
     parser = dp.ofproto_parser
 
-    result = None
     action_type = dic.get('type')
     if action_type == 'OUTPUT':
         out_port = int(dic.get('port', ofp.OFPP_ANY))
@@ -94,7 +93,7 @@ def to_action(dp, dic):
     elif action_type == 'POP_PBB':
         result = parser.OFPActionPopPbb()
     else:
-        LOG.debug('Unknown action type: %s' % action_type)
+        result = None
 
     return result
 
-- 
1.9.1


------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls. 
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
_______________________________________________
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to