Skip to content

Commit ad5a80f

Browse files
committed
Use virtualenv Python for stub connections to workaround problem
../data/stubs/stub-kubectl.py exec -it localhost -- /usr/bin/python -c "...": Traceback (most recent call last): File "<string>", line 1, in <module> LookupError: unknown encoding: base64 It's not clear why this is happening. "stub-kubectl.py" is executed with the 2.7 virtualenv, while the exec() that happens inside stub-kubectl was for "/usr/bin/python". That second Python can't find chunks of its stdlib: stat("/usr/lib/python2.7/encodings/base64", 0x7ffde8744c60) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.7/encodings/base64.so", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.7/encodings/base64module.so", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.7/encodings/base64.py", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/lib/python2.7/encodings/base64.pyc", O_RDONLY) = -1 ENOENT (No such file or directory) write(2, "Traceback (most recent call last):\n", 35) = 35 write(2, " File \"<string>\", line 1, in <module>\n", 39) = 39
1 parent ab9a80c commit ad5a80f

File tree

7 files changed

+7
-0
lines changed

7 files changed

+7
-0
lines changed

tests/ansible/integration/stub_connections/kubectl.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
- custom_python_detect_environment:
1414
vars:
1515
ansible_connection: kubectl
16+
ansible_python_interpreter: python # avoid Travis virtualenv breakage
1617
mitogen_kubectl_path: stub-kubectl.py
1718
register: out
1819

tests/ansible/integration/stub_connections/lxc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
- custom_python_detect_environment:
1111
vars:
1212
ansible_connection: lxc
13+
ansible_python_interpreter: python # avoid Travis virtualenv breakage
1314
mitogen_lxc_attach_path: stub-lxc-attach.py
1415
register: out
1516

tests/ansible/integration/stub_connections/lxd.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
- custom_python_detect_environment:
1111
vars:
1212
ansible_connection: lxd
13+
ansible_python_interpreter: python # avoid Travis virtualenv breakage
1314
mitogen_lxc_path: stub-lxc.py
1415
register: out
1516

tests/ansible/integration/stub_connections/mitogen_doas.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
- custom_python_detect_environment:
1111
vars:
1212
ansible_connection: mitogen_doas
13+
ansible_python_interpreter: python # avoid Travis virtualenv breakage
1314
ansible_doas_exe: stub-doas.py
1415
ansible_user: someuser
1516
register: out

tests/ansible/integration/stub_connections/mitogen_sudo.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
- custom_python_detect_environment:
1111
vars:
1212
ansible_connection: mitogen_sudo
13+
ansible_python_interpreter: python # avoid Travis virtualenv breakage
1314
ansible_user: root
1415
ansible_become_exe: stub-sudo.py
1516
ansible_become_flags: -H --type=sometype --role=somerole

tests/ansible/integration/stub_connections/setns_lxc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
-i localhost,
1919
-c setns
2020
-e mitogen_kind=lxc
21+
-e ansible_python_interpreter=python
2122
-e mitogen_lxc_info_path={{git_basedir}}/tests/data/stubs/stub-lxc-info.py
2223
-m shell
2324
-a "echo hi"

tests/ansible/integration/stub_connections/setns_lxd.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
-i localhost,
1919
-c setns
2020
-e mitogen_kind=lxd
21+
-e ansible_python_interpreter=python
2122
-e mitogen_lxc_path={{git_basedir}}/tests/data/stubs/stub-lxc.py
2223
-m shell
2324
-a "echo hi"

0 commit comments

Comments
 (0)