[SDFAB-1197] First stab to update ONOS to py3
Update has been performed only on the scripts and the
executables strictly necessary for the following use cases:
- Build (including Intellij)
- Tests (including Intellij)
- Docker build (including dev and yourkit)
- Upload snapshot (including local)
- Release
Finally, fix the ability to run ONOS using onos-local targets,
stc and docker stc (aka up4 stc env). Last but not least, updated
the azul image to a newer one which exports also the PYTHONENCODING
Change-Id: Ie96f3a9c76dbba83b1fc3896a372f1045d3d7ccc
diff --git a/tools/build/bazel/dependencies_pom_generator.py b/tools/build/bazel/dependencies_pom_generator.py
index f2df0c2..8c6483f 100755
--- a/tools/build/bazel/dependencies_pom_generator.py
+++ b/tools/build/bazel/dependencies_pom_generator.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# Copyright 2019-present Open Networking Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -20,7 +20,7 @@
def resolve(mvn_coord):
mvn_pieces = mvn_coord.split(":")
if mvn_pieces[0] != "mvn":
- raise ("Invalid Maven coordinate: %s" % mvn_coord)
+ raise ValueError("Invalid Maven coordinate: %s" % mvn_coord)
return dict(
groupId=mvn_pieces[1],
artifactId=mvn_pieces[2],
@@ -79,7 +79,7 @@
dep_template.format(scope='test', **deps[x])
for x in test_deps])
else:
- for old, new in var_dict.items():
+ for old, new in list(var_dict.items()):
line = line.replace(old, new)
new_lines.append(line)
@@ -111,7 +111,7 @@
for var in args.vars:
pieces = var.split('=')
if len(pieces) != 2:
- raise ("Invalid var '%s'" % var)
+ raise ValueError("Invalid var '%s'" % var)
processed_vars["<!-- %s -->" % pieces[0]] = pieces[1]
generate_pom(