Author: asavu
Date: Tue Oct 4 14:37:32 2011
New Revision: 1178817
URL: http://svn.apache.org/viewvc?rev=1178817&view=rev
Log:
WHIRR-382. Upgrade to Commons Configuration 1.7 (asavu)
Modified:
whirr/trunk/CHANGES.txt
whirr/trunk/core/src/main/java/org/apache/whirr/ClusterSpec.java
whirr/trunk/core/src/test/java/org/apache/whirr/ClusterSpecTest.java
whirr/trunk/pom.xml
whirr/trunk/services/puppet/ (props changed)
Modified: whirr/trunk/CHANGES.txt
URL:
http://svn.apache.org/viewvc/whirr/trunk/CHANGES.txt?rev=1178817&r1=1178816&r2=1178817&view=diff
==============================================================================
--- whirr/trunk/CHANGES.txt (original)
+++ whirr/trunk/CHANGES.txt Tue Oct 4 14:37:32 2011
@@ -20,6 +20,8 @@ Trunk (unreleased changes)
WHIRR-376. Launching a BYON cluster doesn't produce an instances file.
(kve)
+ WHIRR-382. Upgrade to Commons Configuration 1.7 (asavu)
+
BUG FIXES
WHIRR-377. Fix broken CLI logging config. (asavu via tomwhite)
Modified: whirr/trunk/core/src/main/java/org/apache/whirr/ClusterSpec.java
URL:
http://svn.apache.org/viewvc/whirr/trunk/core/src/main/java/org/apache/whirr/ClusterSpec.java?rev=1178817&r1=1178816&r2=1178817&view=diff
==============================================================================
--- whirr/trunk/core/src/main/java/org/apache/whirr/ClusterSpec.java (original)
+++ whirr/trunk/core/src/main/java/org/apache/whirr/ClusterSpec.java Tue Oct 4
14:37:32 2011
@@ -62,19 +62,7 @@ import com.jcraft.jsch.KeyPair;
public class ClusterSpec {
private static final Logger LOG = LoggerFactory.getLogger(ClusterSpec.class);
-
- static {
- // Environment variable interpolation (e.g. {env:MY_VAR}) is supported
- // natively in Commons Configuration 1.7, but until it's released we
- // do it ourselves here
- ConfigurationInterpolator.registerGlobalLookup("env", new StrLookup() {
- @Override
- public String lookup(String key) {
- return System.getenv(key);
- }
- });
- }
-
+
public enum Property {
CLUSTER_NAME(String.class, false, "The name of the cluster " +
"to operate on. E.g. hadoopcluster."),
Modified: whirr/trunk/core/src/test/java/org/apache/whirr/ClusterSpecTest.java
URL:
http://svn.apache.org/viewvc/whirr/trunk/core/src/test/java/org/apache/whirr/ClusterSpecTest.java?rev=1178817&r1=1178816&r2=1178817&view=diff
==============================================================================
--- whirr/trunk/core/src/test/java/org/apache/whirr/ClusterSpecTest.java
(original)
+++ whirr/trunk/core/src/test/java/org/apache/whirr/ClusterSpecTest.java Tue
Oct 4 14:37:32 2011
@@ -100,12 +100,15 @@ public class ClusterSpecTest {
public void testEnvVariableInterpolation() {
Map<String, String> envMap = System.getenv();
assertThat(envMap.isEmpty(), is(false));
+
String undefinedEnvVar = "UNDEFINED_ENV_VAR";
assertThat(envMap.containsKey(undefinedEnvVar), is(false));
+
Entry<String, String> firstEntry = Iterables.get(envMap.entrySet(), 0);
Configuration conf = new PropertiesConfiguration();
conf.setProperty("a", String.format("${env:%s}", firstEntry.getKey()));
conf.setProperty("b", String.format("${env:%s}", undefinedEnvVar));
+
assertThat(conf.getString("a"), is(firstEntry.getValue()));
assertThat(conf.getString("b"),
is(String.format("${env:%s}", undefinedEnvVar)));
Modified: whirr/trunk/pom.xml
URL:
http://svn.apache.org/viewvc/whirr/trunk/pom.xml?rev=1178817&r1=1178816&r2=1178817&view=diff
==============================================================================
--- whirr/trunk/pom.xml (original)
+++ whirr/trunk/pom.xml Tue Oct 4 14:37:32 2011
@@ -134,7 +134,7 @@
<dependency>
<groupId>commons-configuration</groupId>
<artifactId>commons-configuration</artifactId>
- <version>1.6</version>
+ <version>1.7</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
Propchange: whirr/trunk/services/puppet/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Oct 4 14:37:32 2011
@@ -0,0 +1 @@
+target