| |
@@ -112,25 +112,24 @@
|
| |
raise RuntimeError("Could not find container file for launched container")
|
| |
with open(cidfile, "r") as f:
|
| |
name = f.read().strip()
|
| |
- # Need to figure out what python interpreter to use
|
| |
- interpreters = ["/usr/bin/python3", "/usr/bin/python2"]
|
| |
- for interpreter in interpreters:
|
| |
- check_file = ["/usr/bin/docker", "exec", "--user=root", name, "/usr/bin/ls", interpreter]
|
| |
- try:
|
| |
- subprocess.check_call(check_file, stdout=null, stderr=null)
|
| |
- ansible_python_interpreter = interpreter
|
| |
- break
|
| |
- except subprocess.CalledProcessError:
|
| |
- pass
|
| |
+
|
| |
+ # Figure out what whenther python3 interpreter is available
|
| |
+ check_file = ["/usr/bin/docker", "exec", "--user=root", name, "/usr/bin/ls", "/usr/bin/python3"]
|
| |
+ try:
|
| |
+ subprocess.check_call(check_file, stdout=null, stderr=null)
|
| |
+ break
|
| |
+ except subprocess.CalledProcessError:
|
| |
+ pass
|
| |
else:
|
| |
logger.error("Could not set ansible_python_interpreter.")
|
| |
return None
|
| |
+
|
| |
# Directory to place artifacts
|
| |
artifacts = os.environ.get("TEST_ARTIFACTS", os.path.join(os.getcwd(), "artifacts"))
|
| |
# The variables
|
| |
variables = {
|
| |
"ansible_connection": "docker",
|
| |
- "ansible_python_interpreter": ansible_python_interpreter
|
| |
+ "ansible_python_interpreter": "/usr/bin/python3"
|
| |
}
|
| |
# Process of our parent
|
| |
ppid = os.getppid()
|
| |
Since we have already ported to python3 do not look for python2
interpreter