From 1d96a1769846d9d0ecd75f3e4daa4fcaac4b5adc Mon Sep 17 00:00:00 2001 From: abhi Date: Fri, 17 Feb 2012 16:26:15 +0530 Subject: [PATCH] bug 13812: throw error if addition of host fails --- api/src/com/cloud/api/commands/AddHostCmd.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/com/cloud/api/commands/AddHostCmd.java b/api/src/com/cloud/api/commands/AddHostCmd.java index a71f672288f..f931fe61f77 100755 --- a/api/src/com/cloud/api/commands/AddHostCmd.java +++ b/api/src/com/cloud/api/commands/AddHostCmd.java @@ -142,7 +142,7 @@ public class AddHostCmd extends BaseCmd { List result = _resourceService.discoverHosts(this); ListResponse response = new ListResponse(); List hostResponses = new ArrayList(); - if (result != null) { + if (result != null && result.size() > 0) { for (Host host : result) { HostResponse hostResponse = _responseGenerator.createHostResponse(host); hostResponses.add(hostResponse);