[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/post-netcfg.py b/tools/test/scenarios/bin/post-netcfg.py
index 6104f2c..6c3dcbc 100755
--- a/tools/test/scenarios/bin/post-netcfg.py
+++ b/tools/test/scenarios/bin/post-netcfg.py
@@ -1,12 +1,11 @@
-#! /usr/bin/env python
-
+#! /usr/bin/env python3
import requests
from requests.auth import HTTPBasicAuth
import sys
if len(sys.argv) != 3:
- print "usage: post-netcfg onos-node json-file-name"
+ print("usage: post-netcfg onos-node json-file-name")
sys.exit(1)
node = sys.argv[1]
@@ -20,7 +19,7 @@
data=configJson)
if request.status_code != 200:
- print request.text
+ print(request.text)
sys.exit(1)
sys.exit(0)