mirror of
				https://github.com/apache/cloudstack.git
				synced 2025-11-04 00:02:37 +01:00 
			
		
		
		
	CLOUDSTACK-9937 : dedicateCluster API response does not return correct detail in response
This commit is contained in:
		
							parent
							
								
									1bd66cb03e
								
							
						
					
					
						commit
						7364616aa4
					
				@ -105,14 +105,12 @@ public class DedicateClusterCmd extends BaseAsyncCmd {
 | 
				
			|||||||
        List<? extends DedicatedResources> result = dedicatedService.dedicateCluster(getClusterId(), getDomainId(), getAccountName());
 | 
					        List<? extends DedicatedResources> result = dedicatedService.dedicateCluster(getClusterId(), getDomainId(), getAccountName());
 | 
				
			||||||
        ListResponse<DedicateClusterResponse> response = new ListResponse<DedicateClusterResponse>();
 | 
					        ListResponse<DedicateClusterResponse> response = new ListResponse<DedicateClusterResponse>();
 | 
				
			||||||
        List<DedicateClusterResponse> clusterResponseList = new ArrayList<DedicateClusterResponse>();
 | 
					        List<DedicateClusterResponse> clusterResponseList = new ArrayList<DedicateClusterResponse>();
 | 
				
			||||||
        if (result != null) {
 | 
					
 | 
				
			||||||
            for (DedicatedResources resource : result) {
 | 
					        // List of result should always contain single element as only one cluster will be associated with each cluster ID.
 | 
				
			||||||
                DedicateClusterResponse clusterResponse = dedicatedService.createDedicateClusterResponse(resource);
 | 
					        if (result != null && result.size() == 1) {
 | 
				
			||||||
                clusterResponseList.add(clusterResponse);
 | 
					            DedicateClusterResponse clusterResponse = dedicatedService.createDedicateClusterResponse(result.get(0));
 | 
				
			||||||
            }
 | 
					            clusterResponse.setResponseName(getCommandName());
 | 
				
			||||||
            response.setResponses(clusterResponseList);
 | 
					            this.setResponseObject(clusterResponse);
 | 
				
			||||||
            response.setResponseName(getCommandName());
 | 
					 | 
				
			||||||
            this.setResponseObject(response);
 | 
					 | 
				
			||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to dedicate cluster");
 | 
					            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to dedicate cluster");
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user