mirror of
https://github.com/faucetsdn/ryu.git
synced 2026-05-05 04:16:11 +02:00
ofctl_v1_3: Fix unsuitable error log in mod_meter_entry()
When omit the parameter of "flags" in mod_meter_entry(), following error log will be shown.
example)
1.use mod_meter_entry() with omitting the parameter of "flags".
curl -X POST -d '{
"dpid": 1,
"meter_id": 1
}' http://localhost:8080/stats/meterentry/delete
2.following error log will be shown.
Unknown flags: 0
This patch fixes the problem.
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
parent
0aefad7048
commit
6133901bb5
@ -1008,14 +1008,16 @@ def mod_meter_entry(dp, flow, cmd):
|
||||
'BURST': dp.ofproto.OFPMF_BURST,
|
||||
'STATS': dp.ofproto.OFPMF_STATS}
|
||||
|
||||
flow_flags = flow.get('flags')
|
||||
if not isinstance(flow_flags, list):
|
||||
flow_flags = [flow_flags]
|
||||
flags = 0
|
||||
for flag in flow_flags:
|
||||
flags |= flags_convert.get(flag, 0)
|
||||
if not flags:
|
||||
LOG.error('Unknown flags: %s', flow.get('flags'))
|
||||
if 'flags' in flow:
|
||||
flow_flags = flow['flags']
|
||||
if not isinstance(flow_flags, list):
|
||||
flow_flags = [flow_flags]
|
||||
for flag in flow_flags:
|
||||
if flag not in flags_convert:
|
||||
LOG.error('Unknown flag: %s', flag)
|
||||
continue
|
||||
flags |= flags_convert.get(flag)
|
||||
|
||||
meter_id = int(flow.get('meter_id', 0))
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user