]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-8798 path.home is useless with ES as an external process
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Fri, 21 Jul 2017 13:02:08 +0000 (15:02 +0200)
committerDaniel Schwarz <bartfastiel@users.noreply.github.com>
Wed, 9 Aug 2017 13:09:54 +0000 (15:09 +0200)
server/sonar-process-monitor/src/main/java/org/sonar/application/process/CommandFactoryImpl.java
server/sonar-process-monitor/src/main/java/org/sonar/application/process/EsSettings.java
server/sonar-process-monitor/src/test/java/org/sonar/application/process/EsSettingsTest.java

index 3b35812644592d394d8cd57be4fe29caa1834f2a..8b8c68a0e80bf2fbf5dc0d1395c94af557c7678e 100644 (file)
@@ -71,9 +71,7 @@ public class CommandFactoryImpl implements CommandFactory {
       // TODO add argument to specify yaml configuration file
       .setPort(Integer.valueOf(settingsMap.get("transport.tcp.port")));
 
-    settingsMap.entrySet().stream()
-      .filter(entry -> !"path.home".equals(entry.getKey()))
-      .forEach(entry -> res.addEsOption("-E" + entry.getKey() + "=" + entry.getValue()));
+    settingsMap.forEach((key, value) -> res.addEsOption("-E" + key + "=" + value));
 
     return res;
 
index a93740d81d194895f47eac4986c769d9f9448096..da423d857a9b9da955bbee497008569e776037f8 100644 (file)
@@ -85,9 +85,6 @@ public class EsSettings {
     }
     builder.put("path.data", dataDir.getAbsolutePath());
 
-    String tempPath = props.value(ProcessProperties.PATH_TEMP);
-    builder.put("path.home", new File(tempPath, "es").getAbsolutePath());
-
     // log dir
     String logPath = props.value(ProcessProperties.PATH_LOGS);
     if (StringUtils.isNotEmpty(logPath)) {
index 93dcbdb4966c6b5d1ef3b1cce56d0e7bbb4e8fa2..9e6332aac4d066b5a5286dc0628217c2a9c2c0f1 100644 (file)
@@ -64,7 +64,7 @@ public class EsSettingsTest {
 
     assertThat(generated.get("path.data")).isNotNull();
     assertThat(generated.get("path.logs")).isNotNull();
-    assertThat(generated.get("path.home")).isNotNull();
+    assertThat(generated.get("path.home")).isNull();
 
     // http is disabled for security reasons
     assertThat(generated.get("http.enabled")).isEqualTo("false");
@@ -90,7 +90,7 @@ public class EsSettingsTest {
 
     assertThat(settings.get("path.data")).isEqualTo(new File(dataDir, "es").getAbsolutePath());
     assertThat(settings.get("path.logs")).isEqualTo(logDir.getAbsolutePath());
-    assertThat(settings.get("path.home")).isEqualTo(new File(tempDir, "es").getAbsolutePath());
+    assertThat(settings.get("path.home")).isNull();
   }
 
   @Test