summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMinoru TAKAHASHI <takahashi.minoru7@gmail.com>2016-03-25 16:58:24 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2016-03-27 22:29:18 +0900
commit3484e6e57358a706be850e6123782a0225a8f23d (patch)
treeafd288d8f9a4a3ffa99d4bdb3d72082a6f8d2956
parentd33c9f0fd9b156636f892e01f64ce1c0052493ca (diff)
lib/ofctl_v1_0: Fix a small bug in get_desc_stats() and get_aggregate_flow_stats()
If there is an empty value in the reply msg, there are cases where those methods cause an error. This patch fixes this problem. Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/lib/ofctl_v1_0.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/ryu/lib/ofctl_v1_0.py b/ryu/lib/ofctl_v1_0.py
index 5fe5778d..e75e51a4 100644
--- a/ryu/lib/ofctl_v1_0.py
+++ b/ryu/lib/ofctl_v1_0.py
@@ -302,6 +302,7 @@ def get_desc_stats(dp, waiters):
stats = dp.ofproto_parser.OFPDescStatsRequest(dp, 0)
msgs = []
send_stats_request(dp, stats, waiters, msgs)
+ s = {}
for msg in msgs:
stats = msg.body
@@ -400,7 +401,7 @@ def get_aggregate_flow_stats(dp, waiters, flow=None):
s = {'packet_count': st.packet_count,
'byte_count': st.byte_count,
'flow_count': st.flow_count}
- flows.append(s)
+ flows.append(s)
flows = {str(dp.id): flows}
return flows