summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--ryu/lib/ofctl_v1_0.py6
-rw-r--r--ryu/lib/ofctl_v1_2.py6
-rw-r--r--ryu/lib/ofctl_v1_3.py6
3 files changed, 3 insertions, 15 deletions
diff --git a/ryu/lib/ofctl_v1_0.py b/ryu/lib/ofctl_v1_0.py
index b9a0823f..b15073d8 100644
--- a/ryu/lib/ofctl_v1_0.py
+++ b/ryu/lib/ofctl_v1_0.py
@@ -286,11 +286,7 @@ def get_desc_stats(dp, waiters):
for msg in msgs:
stats = msg.body
- s = {'mfr_desc': stats.mfr_desc,
- 'hw_desc': stats.hw_desc,
- 'sw_desc': stats.sw_desc,
- 'serial_num': stats.serial_num,
- 'dp_desc': stats.dp_desc}
+ s = stats.to_jsondict()[stats.__class__.__name__]
return {str(dp.id): s}
diff --git a/ryu/lib/ofctl_v1_2.py b/ryu/lib/ofctl_v1_2.py
index e5e0a63c..f458d767 100644
--- a/ryu/lib/ofctl_v1_2.py
+++ b/ryu/lib/ofctl_v1_2.py
@@ -306,11 +306,7 @@ def get_desc_stats(dp, waiters):
s = {}
for msg in msgs:
stats = msg.body
- s = {'mfr_desc': stats.mfr_desc,
- 'hw_desc': stats.hw_desc,
- 'sw_desc': stats.sw_desc,
- 'serial_num': stats.serial_num,
- 'dp_desc': stats.dp_desc}
+ s = stats.to_jsondict()[stats.__class__.__name__]
return {str(dp.id): s}
diff --git a/ryu/lib/ofctl_v1_3.py b/ryu/lib/ofctl_v1_3.py
index 5a521811..c52fb644 100644
--- a/ryu/lib/ofctl_v1_3.py
+++ b/ryu/lib/ofctl_v1_3.py
@@ -345,11 +345,7 @@ def get_desc_stats(dp, waiters, to_user=True):
for msg in msgs:
stats = msg.body
- s = {'mfr_desc': stats.mfr_desc,
- 'hw_desc': stats.hw_desc,
- 'sw_desc': stats.sw_desc,
- 'serial_num': stats.serial_num,
- 'dp_desc': stats.dp_desc}
+ s = stats.to_jsondict()[stats.__class__.__name__]
return wrap_dpid_dict(dp, s, to_user)