From 52393362069735aaaf5e51302420d5eec8210eb5 Mon Sep 17 00:00:00 2001 From: Yusuke Iwase Date: Fri, 26 Sep 2014 15:58:02 +0900 Subject: ofctl: Add default value to type field of OFPGroupMod In OF1.2 and OF1.3 Spec, the group type need not be specified for the group delete request. However, an error occurs at mod_group_entry in ofctl_v1_[23].py without specifying group type to delete a group entry. This patch adds default value to type field of OFPGroupMod at mod_group_entry in order to reflect OpenFlow Specification. Signed-off-by: IWASE Yusuke Reviewed-by: Simon Horman Signed-off-by: FUJITA Tomonori --- ryu/lib/ofctl_v1_2.py | 2 +- ryu/lib/ofctl_v1_3.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ryu/lib/ofctl_v1_2.py b/ryu/lib/ofctl_v1_2.py index da300f77..21a3e340 100644 --- a/ryu/lib/ofctl_v1_2.py +++ b/ryu/lib/ofctl_v1_2.py @@ -822,7 +822,7 @@ def mod_group_entry(dp, group, cmd): 'INDIRECT': dp.ofproto.OFPGT_INDIRECT, 'FF': dp.ofproto.OFPGT_FF} - type_ = type_convert.get(group.get('type')) + type_ = type_convert.get(group.get('type', 'ALL')) if type_ is None: LOG.debug('Unknown type: %s', group.get('type')) diff --git a/ryu/lib/ofctl_v1_3.py b/ryu/lib/ofctl_v1_3.py index b60c4cc0..11673247 100644 --- a/ryu/lib/ofctl_v1_3.py +++ b/ryu/lib/ofctl_v1_3.py @@ -1002,7 +1002,7 @@ def mod_group_entry(dp, group, cmd): 'INDIRECT': dp.ofproto.OFPGT_INDIRECT, 'FF': dp.ofproto.OFPGT_FF} - type_ = type_convert.get(group.get('type')) + type_ = type_convert.get(group.get('type', 'ALL')) if type_ is None: LOG.debug('Unknown type: %s', group.get('type')) -- cgit v1.2.3