Code Review
/
integration
/
test.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Fix Flake8 errors
[integration/test.git]
/
tools
/
odl-mdsal-clustering-tests
/
clustering-performance-test
/
onos_stats.py
diff --git
a/tools/odl-mdsal-clustering-tests/clustering-performance-test/onos_stats.py
b/tools/odl-mdsal-clustering-tests/clustering-performance-test/onos_stats.py
index 86d860f5384a8ea4b0235de5afe354f5078aef68..06654b8ff6da075cf41f4711a0b61c2c23746f1d 100644
(file)
--- a/
tools/odl-mdsal-clustering-tests/clustering-performance-test/onos_stats.py
+++ b/
tools/odl-mdsal-clustering-tests/clustering-performance-test/onos_stats.py
@@
-217,14
+217,10
@@
def get_flow_device_pairs(controller='127.0.0.1', port=8181, flow_details=[]):
if rsp.status_code != 200:
return
flows = json.loads(rsp.content)['flows']
if rsp.status_code != 200:
return
flows = json.loads(rsp.content)['flows']
- # print "Flows", flows
- # print "Details", flow_details
for dev_id, ip in flow_details:
for dev_id, ip in flow_details:
- # print "looking for details", dev_id, ip
for f in flows:
# lets identify if it is our flow
if f["treatment"]["instructions"][0]["type"] != "DROP":
for f in flows:
# lets identify if it is our flow
if f["treatment"]["instructions"][0]["type"] != "DROP":
- # print "NOT DROP"
continue
if f["deviceId"] == dev_id:
if "ip" in f["selector"]["criteria"][0]:
continue
if f["deviceId"] == dev_id:
if "ip" in f["selector"]["criteria"][0]:
@@
-233,9
+229,7
@@
def get_flow_device_pairs(controller='127.0.0.1', port=8181, flow_details=[]):
item_idx = 1
else:
continue
item_idx = 1
else:
continue
- # print "Comparing", '%s/32' % str(netaddr.IPAddress(ip))
if f["selector"]["criteria"][item_idx]["ip"] == '%s/32' % str(netaddr.IPAddress(ip)):
if f["selector"]["criteria"][item_idx]["ip"] == '%s/32' % str(netaddr.IPAddress(ip)):
- # print dev_id, ip, f
yield dev_id, f["id"]
break
yield dev_id, f["id"]
break
@@
-246,13
+240,10
@@
def get_flow_to_remove(controller='127.0.0.1', port=8181):
if rsp.status_code != 200:
return
flows = json.loads(rsp.content)['flows']
if rsp.status_code != 200:
return
flows = json.loads(rsp.content)['flows']
- # print "Flows", flows
- # print "Details", flow_details
for f in flows:
# lets identify if it is our flow
if f["treatment"]["instructions"][0]["type"] != "NOACTION":
for f in flows:
# lets identify if it is our flow
if f["treatment"]["instructions"][0]["type"] != "NOACTION":
- # print "NOT DROP"
continue
if "ip" in f["selector"]["criteria"][0]:
item_idx = 0
continue
if "ip" in f["selector"]["criteria"][0]:
item_idx = 0
@@
-260,10
+251,8
@@
def get_flow_to_remove(controller='127.0.0.1', port=8181):
item_idx = 1
else:
continue
item_idx = 1
else:
continue
- # print "Comparing", '%s/32' % str(netaddr.IPAddress(ip))
ipstr = f["selector"]["criteria"][item_idx]["ip"]
if '10.' in ipstr and '/32' in ipstr:
ipstr = f["selector"]["criteria"][item_idx]["ip"]
if '10.' in ipstr and '/32' in ipstr:
- # print dev_id, ip, f
yield (f["deviceId"], f["id"])
yield (f["deviceId"], f["id"])
@@
-278,7
+267,7
@@
def main(*argv):
help='Port on which onos\'s RESTCONF is listening (default is 8181)')
in_args = parser.parse_args(*argv)
help='Port on which onos\'s RESTCONF is listening (default is 8181)')
in_args = parser.parse_args(*argv)
- print
in_args
+ print
(in_args)
# get device ids
base_dev_ids = get_device_ids(controller=in_args.host)
# get device ids
base_dev_ids = get_device_ids(controller=in_args.host)
@@
-288,13
+277,13
@@
def main(*argv):
# prepare func
preparefnc = _prepare_post # noqa # FIXME: This script seems to be unfinished!
# prepare func
preparefnc = _prepare_post # noqa # FIXME: This script seems to be unfinished!
- print
"BASELINE:"
- print
" devices:", len(base_dev_ids
)
- print
" flows :", len(base_flow_ids
)
+ print
("BASELINE:")
+ print
(" devices:", len(base_dev_ids)
)
+ print
(" flows :", len(base_flow_ids)
)
# lets print some stats
# lets print some stats
- print
"\n\nSome stats monitoring ...."
- print
get_flow_simple_stats(controller=in_args.host
)
+ print
("\n\nSome stats monitoring ....")
+ print
(get_flow_simple_stats(controller=in_args.host)
)
if __name__ == "__main__":
if __name__ == "__main__":