karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbono...@apache.org
Subject karaf-decanter git commit: [KARAF-4580] Disable elasticsearch plugins path on Windows
Date Tue, 19 Jul 2016 05:11:22 GMT
Repository: karaf-decanter
Updated Branches:
  refs/heads/master 175c91cad -> 40a9548d0


[KARAF-4580] Disable elasticsearch plugins path on Windows


Project: http://git-wip-us.apache.org/repos/asf/karaf-decanter/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf-decanter/commit/40a9548d
Tree: http://git-wip-us.apache.org/repos/asf/karaf-decanter/tree/40a9548d
Diff: http://git-wip-us.apache.org/repos/asf/karaf-decanter/diff/40a9548d

Branch: refs/heads/master
Commit: 40a9548d0d0ca21c6f32f84ea0797c7fa61cb7b5
Parents: 175c91c
Author: Jean-Baptiste Onofré <jbonofre@apache.org>
Authored: Tue Jul 19 07:10:47 2016 +0200
Committer: Jean-Baptiste Onofré <jbonofre@apache.org>
Committed: Tue Jul 19 07:10:47 2016 +0200

----------------------------------------------------------------------
 .../org/apache/karaf/decanter/elasticsearch/EmbeddedNode.java | 6 +++++-
 .../org/apache/karaf/decanter/elasticsearch/EmbeddedNode.java | 7 +++----
 2 files changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf-decanter/blob/40a9548d/elasticsearch-1.x/src/main/java/org/apache/karaf/decanter/elasticsearch/EmbeddedNode.java
----------------------------------------------------------------------
diff --git a/elasticsearch-1.x/src/main/java/org/apache/karaf/decanter/elasticsearch/EmbeddedNode.java
b/elasticsearch-1.x/src/main/java/org/apache/karaf/decanter/elasticsearch/EmbeddedNode.java
index db7150e..7b96587 100644
--- a/elasticsearch-1.x/src/main/java/org/apache/karaf/decanter/elasticsearch/EmbeddedNode.java
+++ b/elasticsearch-1.x/src/main/java/org/apache/karaf/decanter/elasticsearch/EmbeddedNode.java
@@ -60,6 +60,8 @@ public class EmbeddedNode {
     public static String HTTP_CORS_ENABLED = "http.cors.enabled";
     public static String HTTP_CORS_ALLOW_ORIGIN = "http.cors.allow-origin";
 
+    private static final boolean IS_WINDOWS = System.getProperty("os.name").contains("indow");
+
     @SuppressWarnings("unchecked")
     @Activate
     public void acticate(ComponentContext context) throws Exception {
@@ -106,7 +108,9 @@ public class EmbeddedNode {
        	settingsBuilder.put(NETWORK_HOST, getConfig(config, settings, NETWORK_HOST, "127.0.0.1"));
        	settingsBuilder.put(PORT, getConfig(config, settings, PORT, 9300));
        	settingsBuilder.put(CLUSTER_ROUTING_SCHEDULE, getConfig(config, settings, CLUSTER_ROUTING_SCHEDULE,
"50ms"));
-       	settingsBuilder.put(PATH_PLUGINS, getConfig(config, settings, PATH_PLUGINS, pluginsFile.getAbsolutePath()));
+        if (!IS_WINDOWS) {
+       	    settingsBuilder.put(PATH_PLUGINS, getConfig(config, settings, PATH_PLUGINS, pluginsFile.getAbsolutePath()));
+        }
        	settingsBuilder.put(HTTP_CORS_ENABLED, getConfig(config, settings, HTTP_CORS_ENABLED,
"true"));
        	settingsBuilder.put(HTTP_CORS_ALLOW_ORIGIN, getConfig(config, settings, HTTP_CORS_ALLOW_ORIGIN,
"/.*/"));
         

http://git-wip-us.apache.org/repos/asf/karaf-decanter/blob/40a9548d/elasticsearch-2.x/src/main/java/org/apache/karaf/decanter/elasticsearch/EmbeddedNode.java
----------------------------------------------------------------------
diff --git a/elasticsearch-2.x/src/main/java/org/apache/karaf/decanter/elasticsearch/EmbeddedNode.java
b/elasticsearch-2.x/src/main/java/org/apache/karaf/decanter/elasticsearch/EmbeddedNode.java
index 3510e60..c63673d 100644
--- a/elasticsearch-2.x/src/main/java/org/apache/karaf/decanter/elasticsearch/EmbeddedNode.java
+++ b/elasticsearch-2.x/src/main/java/org/apache/karaf/decanter/elasticsearch/EmbeddedNode.java
@@ -101,11 +101,10 @@ public class EmbeddedNode {
        	settingsBuilder.put(NODE_NAME, getConfig(config, settings, NODE_NAME, getNodeName()));
        	settingsBuilder.put(NETWORK_HOST, getConfig(config, settings, NETWORK_HOST, "127.0.0.1"));
        	settingsBuilder.put(CLUSTER_ROUTING_SCHEDULE, getConfig(config, settings, CLUSTER_ROUTING_SCHEDULE,
"50ms"));
-        String pluginsPath = pluginsFile.getAbsolutePath();
-        if (IS_WINDOWS) {
-            pluginsPath = pluginsPath.substring(1);
+        if (!IS_WINDOWS) {
+            String pluginsPath = pluginsFile.getAbsolutePath();
+       	    settingsBuilder.put(PATH_PLUGINS, getConfig(config, settings, PATH_PLUGINS, pluginsPath));
         }
-       	settingsBuilder.put(PATH_PLUGINS, getConfig(config, settings, PATH_PLUGINS, pluginsPath));
        	settingsBuilder.put(HTTP_CORS_ENABLED, getConfig(config, settings, HTTP_CORS_ENABLED,
"true"));
        	settingsBuilder.put(HTTP_CORS_ALLOW_ORIGIN, getConfig(config, settings, HTTP_CORS_ALLOW_ORIGIN,
"/.*/"));
         settingsBuilder.put(INDEX_MAX_RESULT_WINDOW, getConfig(config, settings, INDEX_MAX_RESULT_WINDOW,
"2147483647"));


Mime
View raw message