Github user bourneagain commented on a diff in the pull request: https://github.com/apache/storm/pull/575#discussion_r33894593 --- Diff: storm-core/src/jvm/backtype/storm/utils/ShellProcess.java --- @@ -48,8 +50,31 @@ public ShellProcess(String[] command) { this.command = command; } + public void setEnv(Map<String, String> env) { + this.env = env; + } + + private void modifyEnvironment(Map<String, String> buildEnv) { + for (Map.Entry<String, String> entry : env.entrySet()) { + if ("PATH".equals(entry.getKey())) { + buildEnv.put("PATH", buildEnv.get("PATH") + File.pathSeparatorChar + env.get("PATH")); + } else { + buildEnv.put(entry.getKey(), entry.getValue()); + } + } + } + + public Number launch(Map conf, TopologyContext context) { ProcessBuilder builder = new ProcessBuilder(command); + if (!env.isEmpty()) { + Map<String, String> buildEnv = builder.environment(); + modifyEnvironment(buildEnv); + } + for(Map.Entry<String, String> entry : builder.environment().entrySet()) { --- End diff -- @HeartSaVioR , Sorry I am not sure what you meant here. The code (line 70) is checking if the user had passed any custom environment map only after which it calls the modifyEnvironment with the existing environment map for modification. Dd you mean to include debug message for better clarity within this block ?
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---