From b4605fbf2fb6dafd1c3afe119196c196f8e39cdf Mon Sep 17 00:00:00 2001 From: Sheng Yang Date: Mon, 16 May 2011 11:24:33 -0700 Subject: [PATCH] Fix SSL Keystore path in the development version Now the cloud.keystore would at the same path as file "db.properties", which should make both development version and distribution version happy. --- server/src/com/cloud/server/ConfigurationServerImpl.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/src/com/cloud/server/ConfigurationServerImpl.java b/server/src/com/cloud/server/ConfigurationServerImpl.java index 1e48c800300..16f3388c463 100644 --- a/server/src/com/cloud/server/ConfigurationServerImpl.java +++ b/server/src/com/cloud/server/ConfigurationServerImpl.java @@ -458,10 +458,14 @@ public class ConfigurationServerImpl implements ConfigurationServer { } String dbString = _configDao.getValue("ssl.keystore"); - String keystorePath = "/etc/cloud/management/cloud.keystore"; + File confFile= PropertiesUtil.findConfigFile("db.properties"); + /* This line may throw a NPE, but that's due to fail to find db.properities, meant some bugs in the other places */ + String confPath = confFile.getParent(); + String keystorePath = confPath + "/cloud.keystore"; File keystoreFile = new File(keystorePath); boolean dbExisted = (dbString != null && !dbString.isEmpty()); + s_logger.info("SSL keystore located at " + keystorePath); try { if (!dbExisted) { if (!keystoreFile.exists()) {