brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sjcorb...@apache.org
Subject [1/3] git commit: Brooklyn starts if brooklyn.properties is missing
Date Fri, 15 Aug 2014 21:55:57 GMT
Repository: incubator-brooklyn
Updated Branches:
  refs/heads/master 14af1a510 -> 21a037f75


Brooklyn starts if brooklyn.properties is missing


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

Branch: refs/heads/master
Commit: 8476673181c54890ad5e71630b4199732ef9d142
Parents: 14af1a5
Author: Sam Corbett <sam.corbett@cloudsoftcorp.com>
Authored: Fri Aug 15 18:37:34 2014 +0100
Committer: Sam Corbett <sam.corbett@cloudsoftcorp.com>
Committed: Fri Aug 15 18:37:34 2014 +0100

----------------------------------------------------------------------
 .../src/main/java/brooklyn/launcher/BrooklynLauncher.java      | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/84766731/usage/launcher/src/main/java/brooklyn/launcher/BrooklynLauncher.java
----------------------------------------------------------------------
diff --git a/usage/launcher/src/main/java/brooklyn/launcher/BrooklynLauncher.java b/usage/launcher/src/main/java/brooklyn/launcher/BrooklynLauncher.java
index 083763d..6a2eab6 100644
--- a/usage/launcher/src/main/java/brooklyn/launcher/BrooklynLauncher.java
+++ b/usage/launcher/src/main/java/brooklyn/launcher/BrooklynLauncher.java
@@ -443,7 +443,7 @@ public class BrooklynLauncher {
         if (managementContext == null) {
             if (brooklynProperties == null) {
                 Builder builder = new BrooklynProperties.Factory.Builder();
-                if (globalBrooklynPropertiesFile != null) {
+                if (globalBrooklynPropertiesFile != null && fileExists(globalBrooklynPropertiesFile))
{
                     // brooklyn.properties stores passwords (web-console and cloud credentials),

                     // so ensure it has sensible permissions
                     checkFileReadable(globalBrooklynPropertiesFile);
@@ -498,6 +498,10 @@ public class BrooklynLauncher {
         return this;
     }
 
+    private boolean fileExists(String file) {
+        return new File(Os.tidyPath(file)).exists();
+    }
+
     private void checkFileReadable(String file) {
         File f = new File(Os.tidyPath(file));
         if (!f.exists()) {


Mime
View raw message