Updated Branches:
  refs/heads/master b7869ae26 -> 10d211b16

Ensuring pem files are properly split regardless of source OS


Project: http://git-wip-us.apache.org/repos/asf/incubator-jclouds-chef/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-chef/commit/10d211b1
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-chef/tree/10d211b1
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-chef/diff/10d211b1

Branch: refs/heads/master
Commit: 10d211b16be07703a88de9c3f43c5fbdeb3b5868
Parents: b7869ae
Author: zack-shoylev <[email protected]>
Authored: Wed Jun 26 14:40:50 2013 -0500
Committer: Ignasi Barrera <[email protected]>
Committed: Sun Jun 30 18:19:40 2013 +0200

----------------------------------------------------------------------
 .../main/java/org/jclouds/chef/functions/GroupToBootScript.java | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-jclouds-chef/blob/10d211b1/core/src/main/java/org/jclouds/chef/functions/GroupToBootScript.java
----------------------------------------------------------------------
diff --git 
a/core/src/main/java/org/jclouds/chef/functions/GroupToBootScript.java 
b/core/src/main/java/org/jclouds/chef/functions/GroupToBootScript.java
index 332c44b..9154471 100644
--- a/core/src/main/java/org/jclouds/chef/functions/GroupToBootScript.java
+++ b/core/src/main/java/org/jclouds/chef/functions/GroupToBootScript.java
@@ -28,6 +28,7 @@ import java.security.PrivateKey;
 import java.util.Collections;
 import java.util.List;
 import java.util.Map;
+import java.util.regex.Pattern;
 
 import javax.inject.Inject;
 import javax.inject.Named;
@@ -59,6 +60,8 @@ import com.google.inject.TypeLiteral;
  */
 @Singleton
 public class GroupToBootScript implements Function<String, Statement> {
+   private static final Pattern newLinePattern = 
Pattern.compile("(\\r\\n)|(\\n)");
+   
    @VisibleForTesting
    static final Type RUN_LIST_TYPE = new TypeLiteral<Map<String, 
List<String>>>() {
    }.getType();
@@ -108,7 +111,7 @@ public class GroupToBootScript implements Function<String, 
Statement> {
             String.format("chef_server_url \"%s\"", endpoint.get())));
 
       Statement createValidationPem = appendFile(chefConfigDir + 
"{fs}validation.pem",
-            Splitter.on('\n').split(Pems.pem(validatorKey)));
+            Splitter.on(newLinePattern).split(Pems.pem(validatorKey)));
 
       String chefBootFile = chefConfigDir + "{fs}first-boot.json";
       Statement createFirstBoot = appendFile(chefBootFile, 
Collections.singleton(json.toJson(bootstrapConfig)));

Reply via email to