bug 13812: throw error if addition of host fails

This commit is contained in:
abhi 2012-02-17 16:26:15 +05:30
parent 4ec26ae3cb
commit 1d96a17698

View File

@ -142,7 +142,7 @@ public class AddHostCmd extends BaseCmd {
List<? extends Host> result = _resourceService.discoverHosts(this);
ListResponse<HostResponse> response = new ListResponse<HostResponse>();
List<HostResponse> hostResponses = new ArrayList<HostResponse>();
if (result != null) {
if (result != null && result.size() > 0) {
for (Host host : result) {
HostResponse hostResponse = _responseGenerator.createHostResponse(host);
hostResponses.add(hostResponse);