ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
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 GMT
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 <dsen@apache.org>
Authored: Wed Feb 25 14:14:40 2015 +0200
Committer: Dmytro Sen <dsen@apache.org>
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<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;
+    }
   }
 
   /**


Mime
View raw message