cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From raj...@apache.org
Subject [3/6] git commit: updated refs/heads/volume-upload to e08522d
Date Thu, 29 Jan 2015 11:45:52 GMT
volume upload: updating the PSK if its null


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

Branch: refs/heads/volume-upload
Commit: 89ef9e709b0584e4f0245b2596ad7068f813b900
Parents: a710743
Author: Rajani Karuturi <rajanikaruturi@gmail.com>
Authored: Thu Jan 22 08:49:10 2015 +0530
Committer: Rajani Karuturi <rajanikaruturi@gmail.com>
Committed: Thu Jan 29 16:55:26 2015 +0530

----------------------------------------------------------------------
 server/src/com/cloud/server/ConfigurationServerImpl.java | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/89ef9e70/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 5b2a299..d12bd6b 100755
--- a/server/src/com/cloud/server/ConfigurationServerImpl.java
+++ b/server/src/com/cloud/server/ConfigurationServerImpl.java
@@ -46,6 +46,7 @@ import javax.naming.ConfigurationException;
 import com.cloud.utils.nio.Link;
 import org.apache.commons.codec.binary.Base64;
 import org.apache.commons.io.FileUtils;
+import org.apache.commons.lang.StringUtils;
 import org.apache.log4j.Logger;
 
 import org.apache.cloudstack.config.ApiServiceConfiguration;
@@ -976,11 +977,15 @@ public class ConfigurationServerImpl extends ManagerBase implements
Configuratio
      */
     private void updateSecondaryStorageVMSharedKey() {
         try {
-            String key = _configDao.getValue(Config.SSVMPSK.key());
-            if(key == null) {
+            ConfigurationVO configInDB = _configDao.findByName(Config.SSVMPSK.key());
+            if(configInDB == null) {
                 ConfigurationVO configVO = new ConfigurationVO(Config.SSVMPSK.getCategory(),
"DEFAULT", Config.SSVMPSK.getComponent(), Config.SSVMPSK.key(), getPrivateKey(),
                         Config.SSVMPSK.getDescription());
+                s_logger.info("generating a new SSVM PSK. This goes to SSVM on Start");
                 _configDao.persist(configVO);
+            } else if (StringUtils.isEmpty(configInDB.getValue())) {
+                s_logger.info("updating the SSVM PSK with new value. This goes to SSVM on
Start");
+                _configDao.update(Config.SSVMPSK.key(), Config.SSVMPSK.getCategory(), getPrivateKey());
             }
         } catch (NoSuchAlgorithmException ex) {
             s_logger.error("error generating ssvm psk", ex);


Mime
View raw message