sureshanaparti commented on code in PR #10647:
URL: https://github.com/apache/cloudstack/pull/10647#discussion_r2046907009


##########
plugins/hypervisors/vmware/src/main/java/org/apache/cloudstack/api/command/admin/zone/ListVmwareDcsCmd.java:
##########
@@ -74,40 +75,35 @@ public Long getZoneId() {
     @Override
     public void execute() throws ResourceUnavailableException, 
InsufficientCapacityException, ServerApiException, ConcurrentOperationException,
         ResourceAllocationException {
-        List<? extends VmwareDatacenter> vmwareDcList;
+        List<? extends VmwareDatacenter> vmwareDcList = null;
 
         try {
             vmwareDcList = 
_vmwareDatacenterService.listVmwareDatacenters(this);
         } catch (InvalidParameterValueException ie) {
             throw new InvalidParameterValueException("Invalid zone id " + 
getZoneId());
         } catch (Exception e) {
-            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed 
to find associated Vmware DCs associated with zone " + getZoneId());
+            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed 
to find associated VMware DCs associated with zone " + getZoneId());
         }
 
-        ListResponse<VmwareDatacenterResponse> response = new ListResponse<>();
-        List<VmwareDatacenterResponse> vmwareDcResponses = 
getVmwareDatacenterResponses(vmwareDcList);
-        response.setResponses(vmwareDcResponses);
-        response.setResponseName(getCommandName());
-        setResponseObject(response);
-    }
+        ListResponse<VmwareDatacenterResponse> response = new 
ListResponse<VmwareDatacenterResponse>();
+        List<VmwareDatacenterResponse> vmwareDcResponses = new 
ArrayList<VmwareDatacenterResponse>();
 
-    private List<VmwareDatacenterResponse> getVmwareDatacenterResponses(List<? 
extends VmwareDatacenter> vmwareDcList) {
-        List<VmwareDatacenterResponse> vmwareDcResponses = new ArrayList<>();
-
-        if (vmwareDcList != null && !vmwareDcList.isEmpty()) {
+        if (vmwareDcList != null && vmwareDcList.size() > 0) {
             for (VmwareDatacenter vmwareDc : vmwareDcList) {
                 VmwareDatacenterResponse vmwareDcResponse = new 
VmwareDatacenterResponse();
 
                 vmwareDcResponse.setId(vmwareDc.getUuid());
                 vmwareDcResponse.setVcenter(vmwareDc.getVcenterHost());
                 vmwareDcResponse.setName(vmwareDc.getVmwareDatacenterName());
                 vmwareDcResponse.setZoneId(getZoneId());
-                vmwareDcResponse.setObjectName(ApiConstants.VMWARE_DC);
+                vmwareDcResponse.setObjectName("VMwareDC");

Review Comment:
   is this change needed? most of the object names used are in lower case. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to