Repository: cloudstack Updated Branches: refs/heads/volume-upload 631e6e008 -> c2cf2503c
volume upload: persisting the PSK only when its not present Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/c2cf2503 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/c2cf2503 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/c2cf2503 Branch: refs/heads/volume-upload Commit: c2cf2503c190fa4472a49a561fd529f5b48e278f Parents: 631e6e0 Author: Rajani Karuturi <[email protected]> Authored: Tue Jan 13 11:37:22 2015 +0530 Committer: Rajani Karuturi <[email protected]> Committed: Tue Jan 13 11:37:22 2015 +0530 ---------------------------------------------------------------------- server/src/com/cloud/server/ConfigurationServerImpl.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c2cf2503/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 0e48b26..5b2a299 100755 --- a/server/src/com/cloud/server/ConfigurationServerImpl.java +++ b/server/src/com/cloud/server/ConfigurationServerImpl.java @@ -976,7 +976,12 @@ public class ConfigurationServerImpl extends ManagerBase implements Configuratio */ private void updateSecondaryStorageVMSharedKey() { try { - _configDao.update(Config.SSVMPSK.key(), Config.SSVMPSK.getCategory(), getPrivateKey()); + String key = _configDao.getValue(Config.SSVMPSK.key()); + if(key == null) { + ConfigurationVO configVO = new ConfigurationVO(Config.SSVMPSK.getCategory(), "DEFAULT", Config.SSVMPSK.getComponent(), Config.SSVMPSK.key(), getPrivateKey(), + Config.SSVMPSK.getDescription()); + _configDao.persist(configVO); + } } catch (NoSuchAlgorithmException ex) { s_logger.error("error generating ssvm psk", ex); }
