You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ak...@apache.org on 2015/12/24 04:30:41 UTC

[10/10] ignite git commit: Fixed MacOS specific issue with process builder configuration.

Fixed MacOS specific issue with process builder configuration.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/f1a04676
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/f1a04676
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/f1a04676

Branch: refs/heads/ignite-gg-10889
Commit: f1a0467670415aa28a73cbdd1053e3692255b0f6
Parents: 85ffd5a
Author: Alexey Kuznetsov <ak...@apache.org>
Authored: Thu Dec 24 10:26:51 2015 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Thu Dec 24 10:26:51 2015 +0700

----------------------------------------------------------------------
 .../internal/visor/util/VisorTaskUtils.java     | 21 ++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/f1a04676/modules/core/src/main/java/org/apache/ignite/internal/visor/util/VisorTaskUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/util/VisorTaskUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/util/VisorTaskUtils.java
index 016c200..5a81039 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/util/VisorTaskUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/util/VisorTaskUtils.java
@@ -37,6 +37,7 @@ import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Comparator;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.SortedMap;
@@ -863,7 +864,23 @@ public class VisorTaskUtils {
                 if (U.isMacOs()) {
                     StringBuilder envs = new StringBuilder();
 
-                    for (Map.Entry<String, String> entry : System.getenv().entrySet()) {
+                    Map<String, String> macEnv = new HashMap<>(System.getenv());
+
+                    if (envVars != null) {
+                        for (Map.Entry<String, String> ent : envVars.entrySet())
+                            if (macEnv.containsKey(ent.getKey())) {
+                                String old = macEnv.get(ent.getKey());
+
+                                if (old == null || old.isEmpty())
+                                    macEnv.put(ent.getKey(), ent.getValue());
+                                else
+                                    macEnv.put(ent.getKey(), old + ':' + ent.getValue());
+                            }
+                            else
+                                macEnv.put(ent.getKey(), ent.getValue());
+                    }
+
+                    for (Map.Entry<String, String> entry : macEnv.entrySet()) {
                         String val = entry.getValue();
 
                         if (val.indexOf(';') < 0 && val.indexOf('\'') < 0)
@@ -871,7 +888,7 @@ public class VisorTaskUtils {
                                     entry.getKey(), val.replace('\n', ' ').replace("'", "\'")));
                     }
 
-                    run.add(openInConsole(null, envVars, envs.toString(), ignite, quitePar, nodeCfg));
+                    run.add(openInConsole(envs.toString(), ignite, quitePar, nodeCfg));
                 } else
                     run.add(openInConsole(null, envVars, ignite, quitePar, nodeCfg));
             }