Repository: ambari Updated Branches: refs/heads/branch-2.0.0 3e215bf72 -> 11f30ba26
AMBARI-9788 Ambari UI shows message about host checks even after failed bootstrap (dsen) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/11f30ba2 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/11f30ba2 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/11f30ba2 Branch: refs/heads/branch-2.0.0 Commit: 11f30ba26f679bd0888aa5efc446d4cfd3007a35 Parents: 3e215bf Author: Dmytro Sen <[email protected]> Authored: Wed Feb 25 14:44:16 2015 +0200 Committer: Dmytro Sen <[email protected]> Committed: Wed Feb 25 14:45:17 2015 +0200 ---------------------------------------------------------------------- .../ambari/server/bootstrap/BootStrapImpl.java | 29 ++++++++++++++------ 1 file changed, 21 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/11f30ba2/ambari-server/src/main/java/org/apache/ambari/server/bootstrap/BootStrapImpl.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/bootstrap/BootStrapImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/bootstrap/BootStrapImpl.java index 3f7736f..c24eb49 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/bootstrap/BootStrapImpl.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/bootstrap/BootStrapImpl.java @@ -114,14 +114,27 @@ public class BootStrapImpl { } requestId++; - bsRunner = new BSRunner(this, info, bootStrapDir.toString(), - bootScript, bootSetupAgentScript, bootSetupAgentPassword, requestId, 0L, - this.masterHostname, info.isVerbose(), this.clusterOsFamily, this.projectVersion, this.serverPort); - bsRunner.start(); - response.setStatus(BSRunStat.OK); - response.setLog("Running Bootstrap now."); - response.setRequestId(requestId); - return response; + if (info.getHosts() == null || info.getHosts().isEmpty()) { + BootStrapStatus status = new BootStrapStatus(); + status.setLog("Host list is empty."); + status.setHostsStatus(new ArrayList<BSHostStatus>()); + status.setStatus(BootStrapStatus.BSStat.ERROR); + updateStatus(requestId, status); + + response.setStatus(BSRunStat.OK); + response.setLog("Host list is empty."); + response.setRequestId(requestId); + return response; + } else { + bsRunner = new BSRunner(this, info, bootStrapDir.toString(), + bootScript, bootSetupAgentScript, bootSetupAgentPassword, requestId, 0L, + this.masterHostname, info.isVerbose(), this.clusterOsFamily, this.projectVersion, this.serverPort); + bsRunner.start(); + response.setStatus(BSRunStat.OK); + response.setLog("Running Bootstrap now."); + response.setRequestId(requestId); + return response; + } } /**
