brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From grk...@apache.org
Subject [1/4] git commit: Make operating system name lowercase for Riak URL
Date Mon, 03 Nov 2014 18:39:30 GMT
Repository: incubator-brooklyn
Updated Branches:
  refs/heads/master 5e6b9908e -> 83011fe09


Make operating system name lowercase for Riak URL


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/48370ae1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/48370ae1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/48370ae1

Branch: refs/heads/master
Commit: 48370ae1390d5eaf25c31f0ee5ab153dbb77ce5c
Parents: 1c17e73
Author: Andrew Kennedy <grkvlt@apache.org>
Authored: Mon Nov 3 15:49:49 2014 +0000
Committer: Andrew Kennedy <grkvlt@apache.org>
Committed: Mon Nov 3 17:40:51 2014 +0000

----------------------------------------------------------------------
 .../brooklyn/entity/nosql/riak/RiakNodeSshDriver.java  | 13 ++++++++++++-
 .../src/main/java/brooklyn/util/text/Strings.java      |  7 ++++++-
 2 files changed, 18 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/48370ae1/software/nosql/src/main/java/brooklyn/entity/nosql/riak/RiakNodeSshDriver.java
----------------------------------------------------------------------
diff --git a/software/nosql/src/main/java/brooklyn/entity/nosql/riak/RiakNodeSshDriver.java
b/software/nosql/src/main/java/brooklyn/entity/nosql/riak/RiakNodeSshDriver.java
index 830a798..42189f6 100644
--- a/software/nosql/src/main/java/brooklyn/entity/nosql/riak/RiakNodeSshDriver.java
+++ b/software/nosql/src/main/java/brooklyn/entity/nosql/riak/RiakNodeSshDriver.java
@@ -18,6 +18,15 @@
  */
 package brooklyn.entity.nosql.riak;
 
+import static brooklyn.util.ssh.BashCommands.*;
+import static java.lang.String.format;
+
+import java.util.List;
+import java.util.Map;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import brooklyn.entity.basic.AbstractSoftwareProcessSshDriver;
 import brooklyn.entity.basic.Attributes;
 import brooklyn.entity.basic.Entities;
@@ -30,6 +39,8 @@ import brooklyn.util.net.Urls;
 import brooklyn.util.os.Os;
 import brooklyn.util.task.DynamicTasks;
 import brooklyn.util.task.ssh.SshTasks;
+import brooklyn.util.text.Strings;
+
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Lists;
@@ -114,7 +125,7 @@ public class RiakNodeSshDriver extends AbstractSoftwareProcessSshDriver
implemen
                 "export PATH=$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                 "which apt-get",
                 ok(sudo("apt-get -y --allow-unauthenticated install logrotate libpam0g-dev
libssl0.9.8")),
-                "export OS_NAME=" + osDetails.getName(),
+                "export OS_NAME=" + Strings.toLowerCase(osDetails.getName()),
                 // TODO: Debian support (default debian image fails with 'sudo: command not
found')
                 "debian".equals(osDetails.getName()) ?
                     "export OS_RELEASE=" + osDetails.getVersion().substring(0, osDetails.getVersion().indexOf("."))
:

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/48370ae1/utils/common/src/main/java/brooklyn/util/text/Strings.java
----------------------------------------------------------------------
diff --git a/utils/common/src/main/java/brooklyn/util/text/Strings.java b/utils/common/src/main/java/brooklyn/util/text/Strings.java
index 4c275c9..a52dcc9 100644
--- a/utils/common/src/main/java/brooklyn/util/text/Strings.java
+++ b/utils/common/src/main/java/brooklyn/util/text/Strings.java
@@ -587,7 +587,7 @@ public class Strings {
 
     public static String toInitialCapOnly(String value) {
         if (value==null || value.length()==0) return value;
-        return value.substring(0, 1).toUpperCase() + value.substring(1).toLowerCase();
+        return value.substring(0, 1).toUpperCase(Locale.ENGLISH) + value.substring(1).toLowerCase(Locale.ENGLISH);
     }
 
     public static String reverse(String name) {
@@ -833,4 +833,9 @@ public class Strings {
         return replaceAllRegex(x, "\\s+", whitespaceReplacement);
     }
 
+    public static String toLowerCase(String value) {
+        if (value==null || value.length()==0) return value;
+        return value.toLowerCase(Locale.ENGLISH);
+    }
+
 }


Mime
View raw message