You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by je...@apache.org on 2012/11/29 22:12:06 UTC

git commit: CLOUDSTACK-459: cloudstack UI - create network offering - When capability ElasticIp=true is passed to API, if capability associatePublicIP=true/false is not passed to API, cloudStack API will assume associatePublicIP=true. So, UI has to expli

Updated Branches:
  refs/heads/master 05d3f86b1 -> ec40aff93


CLOUDSTACK-459: cloudstack UI - create network offering - When capability ElasticIp=true is passed to API, if capability associatePublicIP=true/false is not passed to API, cloudStack API will assume associatePublicIP=true. So, UI has to explicitly pass associatePublicIP=false to API if its checkbox is unchecked.


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

Branch: refs/heads/master
Commit: ec40aff931f3bbe3678751964ac75ea00328a765
Parents: 05d3f86
Author: Jessica Wang <je...@citrix.com>
Authored: Thu Nov 29 13:11:37 2012 -0800
Committer: Jessica Wang <je...@citrix.com>
Committed: Thu Nov 29 13:11:37 2012 -0800

----------------------------------------------------------------------
 ui/scripts/configuration.js |   23 ++++++++++++++++++++++-
 1 files changed, 22 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/ec40aff9/ui/scripts/configuration.js
----------------------------------------------------------------------
diff --git a/ui/scripts/configuration.js b/ui/scripts/configuration.js
index ef8376d..bb16138 100644
--- a/ui/scripts/configuration.js
+++ b/ui/scripts/configuration.js
@@ -1720,7 +1720,28 @@
                     inputData[key] = value;
                   }
                 });
-
+								
+							  for(var key1 in inputData) { 								  
+								  /* When capability ElasticIp=true is passed to API, if capability associatePublicIP is not passed to API, cloudStack API will assume associatePublicIP=true. 
+									So, UI has to explicitly pass associatePublicIP=false to API if its checkbox is unchecked. */
+								  if(inputData[key1] == 'ElasticIp') { //ElasticIp checkbox is checked 									 
+										var associatePublicIPExists = false;
+									  for(var key2 in inputData) { 										  
+										  if(inputData[key2] == 'associatePublicIP') {
+											  associatePublicIPExists = true;
+											  break; //break key2 for loop
+											}
+										}											
+                    if(associatePublicIPExists == false) { //but associatePublicIP checkbox is unchecked
+                      //UI explicitly passes associatePublicIP=false to API 
+										  inputData['servicecapabilitylist[' + serviceCapabilityIndex + '].service'] = 'StaticNat';
+											inputData['servicecapabilitylist[' + serviceCapabilityIndex + '].capabilitytype'] = 'associatePublicIP'; 
+											inputData['servicecapabilitylist[' + serviceCapabilityIndex + '].capabilityvalue'] = false; //associatePublicIP checkbox is unchecked 		
+                    }										
+									  break; //break key1 for loop
+									}
+								}
+																
                 // Make supported services list
                 inputData['supportedServices'] = $.map(serviceProviderMap, function(value, key) {
                   return key;