diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java old mode 100644 new mode 100755 index 707adc4eab2..2d830aedf6e --- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java +++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java @@ -749,6 +749,9 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati } else if (type.equals(Float.class)) { errMsg = "There was error in trying to parse value: " + value + ". Please enter a valid float value for parameter " + name; Float.parseFloat(value); + } else if (type.equals(Long.class)) { + errMsg = "There was error in trying to parse value: " + value + ". Please enter a valid long value for parameter " + name; + Long.parseLong(value); } } catch (final Exception e) { // catching generic exception as some throws NullPointerException and some throws NumberFormatExcpeion diff --git a/test/integration/component/test_concurrent_snapshots_limit.py b/test/integration/component/test_concurrent_snapshots_limit.py old mode 100644 new mode 100755 index d4170faa30f..fce1dd4439a --- a/test/integration/component/test_concurrent_snapshots_limit.py +++ b/test/integration/component/test_concurrent_snapshots_limit.py @@ -297,3 +297,16 @@ class TestConcurrentSnapshotLimit(cloudstackTestCase): more than concurrent.snapshots.threshold.perhost\ value successfully created") return + + @attr(tags=["advanced", "basic"], required_hardware="false") + def test_03_concurrent_snapshot_global_value_assignment(self): + """ Test verifies that exception is raised if string value is assigned to + concurrent.snapshots.threshold.perhost parameter. + """ + with self.assertRaises(Exception): + Configurations.update( + self.apiclient, + "concurrent.snapshots.threshold.perhost", + "String" + ) + return \ No newline at end of file