Skip to content

Commit

Permalink
Set PYTHONUNBUFFERED env var when invoking pkexec
Browse files Browse the repository at this point in the history
pkexec has a pretty strict policy around setting environment variables
and will ignore most all of them except for a known, safe subset and a
few vars that may be required for GUI applications (for policies that
opt-in to that). Applications, of course, can still control their own
environment variables. So we can likely have `env` set some variables
then have it exec `ansible-pull`.
  • Loading branch information
kylelaker committed Aug 29, 2021
1 parent 38f871f commit 95b7e64
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion roles/common/templates/uug_ansible_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,9 +418,11 @@ def on_run_clicked(self, _):
)

with TemporaryDirectory() as temp_dir:
# spawn_sync will not perform a path lookup; however, pkexec will
# spawn_sync will not perform a path lookup; however, pkexec and env will
cmd_args = [
'/usr/bin/pkexec',
"env",
"PYTHONUNBUFFERED=1",
'ansible-pull',
'--url',
USER_CONFIG['git_url'],
Expand Down

0 comments on commit 95b7e64

Please sign in to comment.