Skip to content

Commit 3b2b03b

Browse files
authored
Merge pull request #1150 from moreati/local-options
Add and test templated local connection parameters
2 parents f384fc3 + e9bddf0 commit 3b2b03b

File tree

2 files changed

+1
-16
lines changed

2 files changed

+1
-16
lines changed

.ci/localhost_ansible_tests.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33

44
from __future__ import print_function
55

6-
import getpass
7-
import io
86
import os
97
import subprocess
108
import sys
@@ -57,18 +55,6 @@
5755
os.chdir(IMAGE_PREP_DIR)
5856
ci_lib.run("ansible-playbook -c local -i localhost, _user_accounts.yml")
5957

60-
# FIXME Don't hardcode https://github.com/mitogen-hq/mitogen/issues/1022
61-
# and os.environ['USER'] is not populated on Azure macOS runners.
62-
os.chdir(HOSTS_DIR)
63-
with io.open('default.hosts', 'r+', encoding='utf-8') as f:
64-
user = getpass.getuser()
65-
content = f.read()
66-
content = content.replace("{{ lookup('pipe', 'whoami') }}", user)
67-
f.seek(0)
68-
f.write(content)
69-
f.truncate()
70-
ci_lib.dump_file('default.hosts')
71-
7258
cmd = ';'.join([
7359
'from __future__ import print_function',
7460
'import os, sys',

tests/ansible/hosts/default.hosts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
# When running the tests outside CI, make a single 'target' host which is the
55
# local machine. The ansible_user override is necessary since some tests want a
66
# fixed ansible.cfg remote_user setting to test against.
7-
# FIXME Hardcoded by replacement in some CI runs https://github.com/mitogen-hq/mitogen/issues/1022
8-
# and os.environ['USER'] is not populated on Azure macOS runners.
7+
# os.environ['USER'] is an empty string on GitHub Actions macOS runners.
98
target ansible_host=localhost ansible_user="{{ lookup('pipe', 'whoami') }}"
109

1110
[test-targets]

0 commit comments

Comments
 (0)