Do not hide environment variables

* Serialize callback execution.

If the previous callback is still running - kill it
Also it will fix a problem of zombie processes when executing callbacks
from the main thread.

* bugfix: pass an arguments to a callback
This commit is contained in:
Alexander Kukushkin
2016-12-16 17:15:04 +01:00
committed by Oleksii Kliukin
parent a5e79bce9d
commit 663bbb1048
+1 -2
View File
@@ -1,5 +1,4 @@
import logging
import os
import subprocess
from threading import Event, Lock, Thread
@@ -31,7 +30,7 @@ class CallbackExecutor(Thread):
self._callback_event.clear()
with self._lock:
try:
self._process = subprocess.Popen(self._cmd, close_fds=True, env={'PATH': os.environ.get('PATH')})
self._process = subprocess.Popen(self._cmd, close_fds=True)
except Exception:
logger.exception('Failed to execute %s', self._cmd)
continue