brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aleds...@apache.org
Subject [1/3] incubator-brooklyn git commit: BROOKLYN-108: use right installDir on rebind
Date Wed, 24 Dec 2014 11:18:28 GMT
Repository: incubator-brooklyn
Updated Branches:
  refs/heads/master 4a5072e52 -> 16d0b8877


BROOKLYN-108: use right installDir on rebind

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

Branch: refs/heads/master
Commit: c0e49b24080569e579b74adc6ce3cdb09765d2b8
Parents: 4a5072e
Author: Aled Sage <aled.sage@gmail.com>
Authored: Wed Dec 24 10:33:52 2014 +0000
Committer: Aled Sage <aled.sage@gmail.com>
Committed: Wed Dec 24 10:33:52 2014 +0000

----------------------------------------------------------------------
 .../entity/basic/AbstractSoftwareProcessSshDriver.java  | 12 ++++++++++++
 1 file changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/c0e49b24/software/base/src/main/java/brooklyn/entity/basic/AbstractSoftwareProcessSshDriver.java
----------------------------------------------------------------------
diff --git a/software/base/src/main/java/brooklyn/entity/basic/AbstractSoftwareProcessSshDriver.java
b/software/base/src/main/java/brooklyn/entity/basic/AbstractSoftwareProcessSshDriver.java
index 1f21fb7..5139a62 100644
--- a/software/base/src/main/java/brooklyn/entity/basic/AbstractSoftwareProcessSshDriver.java
+++ b/software/base/src/main/java/brooklyn/entity/basic/AbstractSoftwareProcessSshDriver.java
@@ -159,6 +159,12 @@ public abstract class AbstractSoftwareProcessSshDriver extends AbstractSoftwareP
     public String getInstallDir() {
         if (installDir != null) return installDir;
 
+        String existingVal = getEntity().getAttribute(SoftwareProcess.INSTALL_DIR);
+        if (Strings.isNonBlank(existingVal)) { // e.g. on rebind
+            installDir = existingVal;
+            return installDir;
+        }
+
         synchronized (installDirSetupMutex) {
             // previously we looked at sensor value, but we shouldn't as it might have been
converted from the config key value
             // *before* we computed the install label, or that label may have changed since
previous install; now force a recompute
@@ -245,6 +251,12 @@ public abstract class AbstractSoftwareProcessSshDriver extends AbstractSoftwareP
     public String getExpandedInstallDir() {
         if (expandedInstallDir != null) return expandedInstallDir;
         
+        String existingVal = getEntity().getAttribute(SoftwareProcess.EXPANDED_INSTALL_DIR);
+        if (Strings.isNonBlank(existingVal)) { // e.g. on rebind
+            expandedInstallDir = existingVal;
+            return expandedInstallDir;
+        }
+
         String untidiedVal = ConfigToAttributes.apply(getEntity(), SoftwareProcess.EXPANDED_INSTALL_DIR);
         if (Strings.isNonBlank(untidiedVal)) {
             setExpandedInstallDir(Os.tidyPath(untidiedVal));


Mime
View raw message