cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject [3/4] git commit: updated refs/heads/master to 17d5bfa
Date Thu, 03 Dec 2015 08:59:25 GMT
CLOUDSTACK-8868: change the default vm.password.length to 10

also moved it to ConfigDepot


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

Branch: refs/heads/master
Commit: f53188192fb51fe8f7bb56bf71b43fc5c283f2ba
Parents: 97a5d6b
Author: Rajani Karuturi <rajani.karuturi@citrix.com>
Authored: Mon Sep 21 17:11:52 2015 +0530
Committer: Rajani Karuturi <rajani.karuturi@citrix.com>
Committed: Tue Nov 17 16:05:46 2015 +0530

----------------------------------------------------------------------
 server/src/com/cloud/configuration/Config.java     |  8 --------
 .../configuration/ConfigurationManagerImpl.java    |  2 +-
 .../src/com/cloud/server/ManagementServerImpl.java | 17 +++++++++++++++--
 3 files changed, 16 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f5318819/server/src/com/cloud/configuration/Config.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/configuration/Config.java b/server/src/com/cloud/configuration/Config.java
index 182ec50..25d8437 100644
--- a/server/src/com/cloud/configuration/Config.java
+++ b/server/src/com/cloud/configuration/Config.java
@@ -899,14 +899,6 @@ public enum Config {
             "0",
             "Default disk I/O read rate in requests per second allowed in User vm's disk.",
             null),
-    VmPasswordLength(
-            "Advanced",
-            ManagementServer.class,
-            Integer.class,
-            "vm.password.length",
-            "6",
-            "Specifies the length of a randomly generated password",
-            null),
     VmDiskThrottlingIopsWriteRate(
             "Advanced",
             ManagementServer.class,

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f5318819/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
index 69e70e6..74af277 100644
--- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
+++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
@@ -770,7 +770,7 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
                     throw new InvalidParameterValueException("Please enter a positive value
for the configuration parameter:" + name);
                 }
                 //TODO - better validation for all password pamameters
-                if ("vm.password.length".equalsIgnoreCase(name) && val < 6) {
+                if ("vm.password.length".equalsIgnoreCase(name) && val < 10) {
                     throw new InvalidParameterValueException("Please enter a value greater
than 6 for the configuration parameter:" + name);
                 }
             } catch (final NumberFormatException e) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f5318819/server/src/com/cloud/server/ManagementServerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/server/ManagementServerImpl.java b/server/src/com/cloud/server/ManagementServerImpl.java
index 25071a2..ee6a42d 100644
--- a/server/src/com/cloud/server/ManagementServerImpl.java
+++ b/server/src/com/cloud/server/ManagementServerImpl.java
@@ -504,6 +504,7 @@ import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreManager;
 import org.apache.cloudstack.engine.subsystem.api.storage.StoragePoolAllocator;
 import org.apache.cloudstack.framework.config.ConfigDepot;
 import org.apache.cloudstack.framework.config.ConfigKey;
+import org.apache.cloudstack.framework.config.Configurable;
 import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
 import org.apache.cloudstack.framework.config.impl.ConfigurationVO;
 import org.apache.cloudstack.framework.security.keystore.KeystoreManager;
@@ -671,9 +672,11 @@ import com.cloud.vm.dao.SecondaryStorageVmDao;
 import com.cloud.vm.dao.UserVmDao;
 import com.cloud.vm.dao.VMInstanceDao;
 
-public class ManagementServerImpl extends ManagerBase implements ManagementServer {
+public class ManagementServerImpl extends ManagerBase implements ManagementServer, Configurable
{
     public static final Logger s_logger = Logger.getLogger(ManagementServerImpl.class.getName());
 
+    static final ConfigKey<Integer> vmPasswordLength = new ConfigKey<Integer>("Advanced",
Integer.class, "vm.password.length", "10",
+                                                                                      "Specifies
the length of a randomly generated password", false);
     @Inject
     public AccountManager _accountMgr;
     @Inject
@@ -905,7 +908,7 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
 
     @Override
     public String generateRandomPassword() {
-        final Integer passwordLength = Integer.parseInt(_configDao.getValue("vm.password.length"));
+        final Integer passwordLength = vmPasswordLength.value();
         return PasswordGenerator.generateRandomPassword(passwordLength);
     }
 
@@ -3021,6 +3024,16 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
         return cmdList;
     }
 
+    @Override
+    public String getConfigComponentName() {
+        return ManagementServer.class.getSimpleName();
+    }
+
+    @Override
+    public ConfigKey<?>[] getConfigKeys() {
+        return new ConfigKey<?>[] {vmPasswordLength};
+    }
+
     protected class EventPurgeTask extends ManagedContextRunnable {
         @Override
         protected void runInContext() {


Mime
View raw message