You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by sa...@apache.org on 2014/08/28 12:29:48 UTC

git commit: updated refs/heads/master to 490d499

Repository: cloudstack
Updated Branches:
  refs/heads/master fe6f0cf62 -> 490d499b7


CLOUDSTACK-7453: Network rate field specified with negative value in service offering results in db Exception


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

Branch: refs/heads/master
Commit: 490d499b7fe0fa60dfeb37cfe76fff99fce41018
Parents: fe6f0cf
Author: Saksham Srivastava <sa...@citrix.com>
Authored: Thu Aug 28 15:16:58 2014 +0530
Committer: Saksham Srivastava <sa...@citrix.com>
Committed: Thu Aug 28 15:28:00 2014 +0530

----------------------------------------------------------------------
 .../com/cloud/configuration/ConfigurationManagerImpl.java   | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/490d499b/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 3328b7c..893ee4e 100755
--- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
+++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
@@ -2045,8 +2045,13 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
             allowNetworkRate = true;
         }
 
-        if (cmd.getNetworkRate() != null && !allowNetworkRate) {
-            throw new InvalidParameterValueException("Network rate can be specified only for non-System offering and system offerings having \"domainrouter\" systemvmtype");
+        if (cmd.getNetworkRate() != null) {
+            if(!allowNetworkRate) {
+                throw new InvalidParameterValueException("Network rate can be specified only for non-System offering and system offerings having \"domainrouter\" systemvmtype");
+            }
+            if(cmd.getNetworkRate().intValue() <= 1) {
+                throw new InvalidParameterValueException("Failed to create service offering " + name + ": specify the network rate value more than 0");
+            }
         }
 
         if (cmd.getDeploymentPlanner() != null) {