From 8441f32f02ffe7e47393c41a19c6dc04357f8f24 Mon Sep 17 00:00:00 2001 From: Pranav Saxena Date: Tue, 4 Sep 2012 11:57:06 +0530 Subject: [PATCH] CS-16262:Updating SNMP community and SNMP port does not happen since UI sends the parameters in the old format when the server side call is triggered Reviewed-By:Vijay Venkatachalam --- ui/scripts/autoscaler.js | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/ui/scripts/autoscaler.js b/ui/scripts/autoscaler.js index 05bbe2247c9..aca9b102b11 100644 --- a/ui/scripts/autoscaler.js +++ b/ui/scripts/autoscaler.js @@ -1133,7 +1133,7 @@ data[param+ '.name']=name; data[param+ '.value']=value; index++; - + delete data[name]; return true; }); @@ -1199,7 +1199,26 @@ destroyvmgraceperiod: args.data.destroyVMgracePeriod, snmpcommunity: args.data.snmpCommunity, snmpport: args.data.snmpPort - }; + }; + + var allParamNames=$.map(data,function(value,key){ + return key; + }); + + var notParams =['id','templateid','destroyvmgraceperiod']; + var index=0; + $(allParamNames).each(function() { + var param='counterparam[' + index + ']'; + var name = this.toString(); + var value = data[name]; + if(!value || $.inArray(name,notParams) >-1 ) return true; + data[param+ '.name']=name; + data[param+ '.value']=value; + index++; + delete data[name]; + return true; + }); + if(args.data.username != null && args.data.username.length > 0) { $.extend(data, {