[elbe-devel] [PATCH 11/20] rpcaptcache: move setup of envvars from RPCAptCache into MyMan.setup_env()

Torben Hohn torben.hohn at linutronix.de
Fri Oct 12 11:27:57 CEST 2018


setting values in os.environ might pose race conditions.

Just set these in initialisation code. And move the lines to the new
setup_env() method.

Signed-off-by: Torben Hohn <torben.hohn at linutronix.de>
---
 elbepack/rpcaptcache.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/elbepack/rpcaptcache.py b/elbepack/rpcaptcache.py
index e4131350..28cb08c2 100644
--- a/elbepack/rpcaptcache.py
+++ b/elbepack/rpcaptcache.py
@@ -163,8 +163,6 @@ class RPCAPTCache(InChRootObject):
         self.cache.open(progress=ElbeOpProgress())
 
     def commit(self):
-        os.environ["DEBIAN_FRONTEND"] = "noninteractive"
-        os.environ["DEBCONF_NONINTERACTIVE_SEEN"] = "true"
         self.cache.commit(ElbeAcquireProgress(),
                           ElbeInstallProgress(fileno=self.logfile.fileno()))
         self.cache.open(progress=ElbeOpProgress())
@@ -275,6 +273,8 @@ class MyMan(BaseManager):
         os.environ["LANG"] = "C"
         os.environ["LANGUAGE"] = "C"
         os.environ["LC_ALL"] = "C"
+        os.environ["DEBIAN_FRONTEND"] = "noninteractive"
+        os.environ["DEBCONF_NONINTERACTIVE_SEEN"] = "true"
 
     def start(self):
         BaseManager.start(self,initializer=self.setup_env)
-- 
2.11.0




More information about the elbe-devel mailing list