You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jclouds.apache.org by na...@apache.org on 2013/07/01 00:31:51 UTC
git commit: Ensuring pem files are properly split regardless of
source OS
Updated Branches:
refs/heads/1.6.x 947b058e9 -> 89e938bf1
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/89e938bf
Tree: http://git-wip-us.apache.org/repos/asf/incubator-jclouds-chef/tree/89e938bf
Diff: http://git-wip-us.apache.org/repos/asf/incubator-jclouds-chef/diff/89e938bf
Branch: refs/heads/1.6.x
Commit: 89e938bf1de7cd9228f8a6d5beb1b17eff00be64
Parents: 947b058
Author: zack-shoylev <za...@rackspace.com>
Authored: Mon Jul 1 00:26:13 2013 +0200
Committer: Ignasi Barrera <ig...@gmail.com>
Committed: Mon Jul 1 00:30:27 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/89e938bf/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 86e93a5..741f1b5 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;
@@ -57,6 +58,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();
@@ -101,7 +104,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";