testutils: avoid using constants not defined for the current OpenFlow version
diff --git a/src/python/oftest/testutils.py b/src/python/oftest/testutils.py
index 5c3f6f3..6609fc6 100644
--- a/src/python/oftest/testutils.py
+++ b/src/python/oftest/testutils.py
@@ -1152,10 +1152,12 @@
stats.extend(reply.entries)
return stats
-def get_flow_stats(test, match, table_id=0xff, out_port=ofp.OFPP_NONE):
+def get_flow_stats(test, match, table_id=0xff, out_port=None):
"""
Retrieve a list of flow stats entries.
"""
+ if out_port == None:
+ out_port = ofp.OFPP_NONE
req = ofp.message.flow_stats_request(match=match,
table_id=table_id,
out_port=out_port)
@@ -1176,7 +1178,7 @@
return get_stats(test, req)
def verify_flow_stats(test, match, table_id=0xff,
- out_port=ofp.OFPP_NONE,
+ out_port=None,
initial=[],
pkts=None, bytes=None):
"""
@@ -1186,6 +1188,9 @@
get_flow_stats(). If 'initial' is not given the counters are assumed to
begin at 0.
"""
+ if out_port == None:
+ out_port = ofp.OFPP_NONE
+
def accumulate(stats):
pkts_acc = bytes_acc = 0
for stat in stats: