Quellcode durchsuchen

AMBARI-11071 ambari agent is ignoring all env vars being set for the user when it runs commands (dsen)

Dmytro Sen vor 10 Jahren
Ursprung
Commit
0b7f6a8f40
1 geänderte Dateien mit 1 neuen und 4 gelöschten Zeilen
  1. 1 4
      ambari-agent/src/main/python/ambari_agent/PythonExecutor.py

+ 1 - 4
ambari-agent/src/main/python/ambari_agent/PythonExecutor.py

@@ -159,14 +159,11 @@ class PythonExecutor:
     to make possible unit testing
     """
     close_fds = None if OSCheck.get_os_family() == OSConst.WINSRV_FAMILY else True
-
+    command_env = dict(os.environ)
     if OSCheck.get_os_family() == OSConst.WINSRV_FAMILY:
-      command_env = dict(os.environ)
       command_env["PYTHONPATH"] = os.pathsep.join(sys.path)
       for k, v in command_env.iteritems():
         command_env[k] = str(v)
-    else:
-      command_env = None
 
     return subprocess.Popen(command,
       stdout=tmpout,