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.
This commit is contained in:
Sheng Yang 2011-05-16 11:24:33 -07:00
parent 5ce631e9d7
commit b4605fbf2f
1 changed files with 5 additions and 1 deletions

View File

@ -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()) {