You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by sv...@apache.org on 2016/10/31 14:34:25 UTC

[1/2] brooklyn-server git commit: Added configuration for template substitution variable map

Repository: brooklyn-server
Updated Branches:
  refs/heads/master 7cf27bdae -> 387a19749


Added configuration for template substitution variable map


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/6fd5100d
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/6fd5100d
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/6fd5100d

Branch: refs/heads/master
Commit: 6fd5100dd59d6ff7eff1685fa62f90a18558d36b
Parents: f97b9eb
Author: Andrew Donald Kennedy <an...@cloudsoftcorp.com>
Authored: Wed Sep 7 00:53:00 2016 +0100
Committer: Andrew Donald Kennedy <an...@cloudsoftcorp.com>
Committed: Wed Sep 7 00:59:10 2016 +0100

----------------------------------------------------------------------
 .../entity/software/base/AbstractSoftwareProcessDriver.java   | 3 ++-
 .../apache/brooklyn/entity/software/base/SoftwareProcess.java | 7 +++++++
 2 files changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/6fd5100d/software/base/src/main/java/org/apache/brooklyn/entity/software/base/AbstractSoftwareProcessDriver.java
----------------------------------------------------------------------
diff --git a/software/base/src/main/java/org/apache/brooklyn/entity/software/base/AbstractSoftwareProcessDriver.java b/software/base/src/main/java/org/apache/brooklyn/entity/software/base/AbstractSoftwareProcessDriver.java
index aaa7cde..d88d4d2 100644
--- a/software/base/src/main/java/org/apache/brooklyn/entity/software/base/AbstractSoftwareProcessDriver.java
+++ b/software/base/src/main/java/org/apache/brooklyn/entity/software/base/AbstractSoftwareProcessDriver.java
@@ -465,7 +465,8 @@ public abstract class AbstractSoftwareProcessDriver implements SoftwareProcessDr
                         .body(new Callable<Object>() {
                             @Override
                             public Integer call() {
-                                return copyTemplate(input.source, input.destination, true, Collections.<String, Object>emptyMap());
+                                Map<String, Object> substitutions = MutableMap.copyOf(entity.config().get(SoftwareProcess.TEMPLATE_SUBSTITUTIONS)).asUnmodifiable();
+                                return copyTemplate(input.source, input.destination, true, substitutions);
                             }
                         })
                         .build();

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/6fd5100d/software/base/src/main/java/org/apache/brooklyn/entity/software/base/SoftwareProcess.java
----------------------------------------------------------------------
diff --git a/software/base/src/main/java/org/apache/brooklyn/entity/software/base/SoftwareProcess.java b/software/base/src/main/java/org/apache/brooklyn/entity/software/base/SoftwareProcess.java
index 883dfb7..8db0051 100644
--- a/software/base/src/main/java/org/apache/brooklyn/entity/software/base/SoftwareProcess.java
+++ b/software/base/src/main/java/org/apache/brooklyn/entity/software/base/SoftwareProcess.java
@@ -166,6 +166,13 @@ public interface SoftwareProcess extends Entity, Startable {
             "modify the machine so that a tty is not subsequently required.",
             false);
 
+    @SetFromFlag("substitutions")
+    MapConfigKey<Object> TEMPLATE_SUBSTITUTIONS = new MapConfigKey.Builder<Object>(Object.class, "template.substitutions")
+            .description("Map of values to be substituted for the keys in any templated files used by the entity")
+            .defaultValue(ImmutableMap.<String,Object>of())
+            .typeInheritance(ConfigInheritance.DEEP_MERGE)
+            .build();
+
     /**
      * Files to be copied to the server before pre-install.
      * <p>


[2/2] brooklyn-server git commit: Closes #321

Posted by sv...@apache.org.
Closes #321

Added configuration for template substitution variable map

Adds a new `ConfigKey<Map<?,?>>` to allow setting further template variable substitutions in YAML.


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/387a1974
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/387a1974
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/387a1974

Branch: refs/heads/master
Commit: 387a1974916cdc414947bf587d26d70edf59c5b5
Parents: 7cf27bd 6fd5100
Author: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Authored: Mon Oct 31 16:34:02 2016 +0200
Committer: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Committed: Mon Oct 31 16:34:02 2016 +0200

----------------------------------------------------------------------
 .../entity/software/base/AbstractSoftwareProcessDriver.java   | 3 ++-
 .../apache/brooklyn/entity/software/base/SoftwareProcess.java | 7 +++++++
 2 files changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/387a1974/software/base/src/main/java/org/apache/brooklyn/entity/software/base/AbstractSoftwareProcessDriver.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/387a1974/software/base/src/main/java/org/apache/brooklyn/entity/software/base/SoftwareProcess.java
----------------------------------------------------------------------