[WIP] ONOS-8091 Port python script and utilities to python3

Steps performed so far:
- Updated bash scripts and similar to explicitly invoke python3 (instead of python)
- Updated all python scripts using 2to3

Testing these changes will be a major headache because:
- different scripts are executed in different environments
  (e.g., Jenkins, cell servers, tutorial VMs, etc.)
- we don’t have control on all environments
- some environments we used to control have been dismissed
  (e.g., cell servers)

The approach for now is to focus on the essentials:
- Jenkins jobs for pre-merge and release

Test and fix everything else as the need arises.

Change-Id: I943e214760c9dea9a7ded0d47ef08adbc0ed0bec
diff --git a/tools/test/scenarios/bin/query-cluster.py b/tools/test/scenarios/bin/query-cluster.py
index 0cac7ac..8d356b3 100755
--- a/tools/test/scenarios/bin/query-cluster.py
+++ b/tools/test/scenarios/bin/query-cluster.py
@@ -1,13 +1,13 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
 
 import requests
 import sys
-import urllib
+import urllib.request, urllib.parse, urllib.error
 
 from requests.auth import HTTPBasicAuth
 
 if len(sys.argv) != 4:
-    print "usage: query-cluster onos-node name cluster-number"
+    print("usage: query-cluster onos-node name cluster-number")
     sys.exit(1)
 
 node = sys.argv[1]
@@ -19,15 +19,15 @@
                            auth=HTTPBasicAuth('onos', 'rocks'))
 
 if topoRequest.status_code != 200:
-    print topoRequest.text
+    print(topoRequest.text)
     sys.exit(1)
 
 topoJson = topoRequest.json()
 
-print "@stc " + name + "Id=" + str(topoJson["id"])
-print "@stc " + name + "DeviceCount=" + str(topoJson["deviceCount"])
-print "@stc " + name + "LinkCount=" + str(topoJson["linkCount"])
-print "@stc " + name + "Root=" + topoJson["root"]
+print("@stc " + name + "Id=" + str(topoJson["id"]))
+print("@stc " + name + "DeviceCount=" + str(topoJson["deviceCount"]))
+print("@stc " + name + "LinkCount=" + str(topoJson["linkCount"]))
+print("@stc " + name + "Root=" + topoJson["root"])
 
 sys.exit(0)