summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2022-07-04 18:19:13 +0200
committerGitHub <noreply@github.com>2022-07-04 18:19:13 +0200
commit9400266d8a89427698b43a9470bb172ecae23fe9 (patch)
treeb9f25e947f0c85356fcaa21f28e09b283dd8ce65 /src
parent4ac086fb0019cc8133668309283e793fa2ea57b1 (diff)
parent325b135e54079e6869d719866ba096dd288cc600 (diff)
downloadvyos-1x-9400266d8a89427698b43a9470bb172ecae23fe9.tar.gz
vyos-1x-9400266d8a89427698b43a9470bb172ecae23fe9.zip
Merge pull request #1388 from zdc/T4528-sagitta
event-handler: T4508: Fixed environment variables
Diffstat (limited to 'src')
-rwxr-xr-xsrc/system/vyos-event-handler.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/system/vyos-event-handler.py b/src/system/vyos-event-handler.py
index 507fdc652..1c85380bc 100755
--- a/src/system/vyos-event-handler.py
+++ b/src/system/vyos-event-handler.py
@@ -15,14 +15,16 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import argparse
-import select
-import re
import json
+import re
+import select
+from copy import deepcopy
from os import getpid, environ
from pathlib import Path
from signal import signal, SIGTERM, SIGINT
-from systemd import journal
from sys import exit
+from systemd import journal
+
from vyos.util import run, dict_search
# Identify this script
@@ -54,7 +56,7 @@ class Analyzer:
script_arguments = dict_search('script.arguments', event_config)
script = f'{script} {script_arguments}'
# Prepare environment
- environment = environ
+ environment = deepcopy(environ)
# Check for additional environment options
if dict_search('script.environment', event_config):
for env_variable, env_value in dict_search(