From 9d3d3b4c24500986b3286baf4a3b2bb1d4f32611 Mon Sep 17 00:00:00 2001 From: Milamber Date: Wed, 11 Jan 2017 12:29:09 +0000 Subject: [PATCH] CLOUDSTACK-9736 Incoherent validation and error message when you change the vm.password.length configuration parameter Default value introduce in schema-430to440.sql are 6 for the length --- .../src/com/cloud/configuration/ConfigurationManagerImpl.java | 4 ++-- server/src/com/cloud/server/ManagementServerImpl.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java index 10136c6bf326..847f1330caf7 100644 --- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java +++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java @@ -797,8 +797,8 @@ private String validateConfigurationValue(final String name, String value, final 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 < 10) { - throw new InvalidParameterValueException("Please enter a value greater than 6 for the configuration parameter:" + name); + if ("vm.password.length".equalsIgnoreCase(name) && val < 6) { + throw new InvalidParameterValueException("Please enter a value greater or equal than 6 for the configuration parameter:" + name); } if ("remote.access.vpn.psk.length".equalsIgnoreCase(name)) { if (val < 8) { diff --git a/server/src/com/cloud/server/ManagementServerImpl.java b/server/src/com/cloud/server/ManagementServerImpl.java index b6a263705fa9..04ee1f2e4d14 100644 --- a/server/src/com/cloud/server/ManagementServerImpl.java +++ b/server/src/com/cloud/server/ManagementServerImpl.java @@ -684,7 +684,7 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServer, Configurable { public static final Logger s_logger = Logger.getLogger(ManagementServerImpl.class.getName()); - static final ConfigKey vmPasswordLength = new ConfigKey("Advanced", Integer.class, "vm.password.length", "10", + static final ConfigKey vmPasswordLength = new ConfigKey("Advanced", Integer.class, "vm.password.length", "6", "Specifies the length of a randomly generated password", false); @Inject public AccountManager _accountMgr;