Return-Path: X-Original-To: apmail-ambari-commits-archive@www.apache.org Delivered-To: apmail-ambari-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EB9F417873 for ; Wed, 25 Feb 2015 12:44:48 +0000 (UTC) Received: (qmail 7701 invoked by uid 500); 25 Feb 2015 12:44:26 -0000 Delivered-To: apmail-ambari-commits-archive@ambari.apache.org Received: (qmail 7669 invoked by uid 500); 25 Feb 2015 12:44:26 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 7660 invoked by uid 99); 25 Feb 2015 12:44:26 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Feb 2015 12:44:26 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id AC026E08E9; Wed, 25 Feb 2015 12:44:26 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: dsen@apache.org To: commits@ambari.apache.org Message-Id: <750ad9bc5c5a4a5aa0922b9b62664a24@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: ambari git commit: AMBARI-9788 Ambari UI shows message about host checks even after failed bootstrap (dsen) Date: Wed, 25 Feb 2015 12:44:26 +0000 (UTC) Repository: ambari Updated Branches: refs/heads/trunk 35539ef00 -> b900461e7 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/b900461e Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b900461e Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b900461e Branch: refs/heads/trunk Commit: b900461e7730e0d43bf90617c659179d15539e86 Parents: 35539ef Author: Dmytro Sen Authored: Wed Feb 25 14:14:40 2015 +0200 Committer: Dmytro Sen Committed: Wed Feb 25 14:44:16 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/b900461e/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()); + 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; + } } /**