Repository: cloudstack
Updated Branches:
  refs/heads/4.5 3a36681b6 -> c987080c2


CLOUDSTACK-7999: Always override local keystore file with the entry in DB


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

Branch: refs/heads/4.5
Commit: c987080c266f4ddb973736a3beb2bf2b07f287b0
Parents: 3a36681
Author: Sheng Yang <[email protected]>
Authored: Mon Dec 1 18:52:15 2014 -0800
Committer: Sheng Yang <[email protected]>
Committed: Mon Dec 1 18:59:25 2014 -0800

----------------------------------------------------------------------
 server/src/com/cloud/server/ConfigurationServerImpl.java | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c987080c/server/src/com/cloud/server/ConfigurationServerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/server/ConfigurationServerImpl.java 
b/server/src/com/cloud/server/ConfigurationServerImpl.java
index 7b0d898..306c0e7 100755
--- a/server/src/com/cloud/server/ConfigurationServerImpl.java
+++ b/server/src/com/cloud/server/ConfigurationServerImpl.java
@@ -638,13 +638,6 @@ public class ConfigurationServerImpl extends ManagerBase 
implements Configuratio
                                 "SSL Keystore for the management servers");
                 _configDao.persist(configVO);
                 s_logger.info("Stored SSL keystore to database.");
-            } else if (null != keystoreFile && keystoreFile.exists()) { // and 
dbExisted
-                // Check if they are the same one, otherwise override with 
local keystore
-                String base64Keystore = getBase64Keystore(keystorePath);
-                if (base64Keystore.compareTo(dbString) != 0) {
-                    _configDao.update("ssl.keystore", "Hidden", 
base64Keystore);
-                    s_logger.info("Updated database keystore with local one.");
-                }
             } else { // !keystoreFile.exists() and dbExisted
                 // Export keystore to local file
                 byte[] storeBytes = Base64.decodeBase64(dbString);
@@ -654,6 +647,7 @@ public class ConfigurationServerImpl extends ManagerBase 
implements Configuratio
                     fo.write(storeBytes);
                     fo.close();
                     Script script = new Script(true, "cp", 5000, null);
+                    script.add("-f");
                     script.add(tmpKeystorePath);
 
                     //There is a chance, although small, that the keystorePath 
is null. In that case, do not add it to the script.

Reply via email to