From 95b7e64b31abbcf6631ffb5ea2fffee4c19afe71 Mon Sep 17 00:00:00 2001 From: Kyle Laker Date: Sat, 28 Aug 2021 21:10:10 -0400 Subject: [PATCH] Set PYTHONUNBUFFERED env var when invoking pkexec 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`. --- roles/common/templates/uug_ansible_wrapper.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/roles/common/templates/uug_ansible_wrapper.py b/roles/common/templates/uug_ansible_wrapper.py index 300766f8..1249a73d 100755 --- a/roles/common/templates/uug_ansible_wrapper.py +++ b/roles/common/templates/uug_ansible_wrapper.py @@ -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'],