CLOUDSTACK-3651: Infrastructure menu - zone detail - listVmwareDcs API only exists in non-oss build, suppress error "The given command does not exist or it is not avaiable for user" from UI for this specific case.

This commit is contained in:
Jessica Wang 2013-07-19 15:17:14 -07:00
parent cd6853cc1a
commit 0cdda2988f

View File

@ -6473,7 +6473,7 @@
}); });
$.ajax({ $.ajax({
url: createURL('listVmwareDcs'), url: createURL('listVmwareDcs'), //listVmwareDcs API exists in only non-oss bild
data: { data: {
zoneid: args.context.physicalResources[0].id zoneid: args.context.physicalResources[0].id
}, },
@ -6485,6 +6485,12 @@
selectedZoneObj.vmwaredcVcenter = vmwaredcs[0].vcenter; selectedZoneObj.vmwaredcVcenter = vmwaredcs[0].vcenter;
selectedZoneObj.vmwaredcId = vmwaredcs[0].id; selectedZoneObj.vmwaredcId = vmwaredcs[0].id;
} }
},
error: function(XMLHttpResponse) { //override default error handling: cloudStack.dialog.notice({ message: parseXMLHttpResponse(XMLHttpResponse)});
if(parseXMLHttpResponse(XMLHttpResponse) == 'The given command does not exist or it is not available for user')
return; //do nothing
else
cloudStack.dialog.notice({ message: parseXMLHttpResponse(XMLHttpResponse)}); //pop up error dialog box if the error is not 'The given command does not exist or it is not available for user'
} }
}); });