poller.waitForComplete();
logger.debug("Bootstrap request id: " + apiBootstrapRequest.getRequestId());
boolean success = false;
boolean allHostsBootstrapped = true;
ApiBootstrapStatus apiBootstrapStatus =
apiManager.getBootstrapStatus(apiBootstrapRequest.getRequestId());
BootstrapStatus bootstrapStatus =
BootstrapStatus.valueOf(apiBootstrapStatus.getStatus());
logger.debug("Bootstrap status " + bootstrapStatus);
if (!bootstrapStatus.isFailedState()) {
success = true;
}
int bootstrapedHostCount =
apiBootstrapStatus.getApiBootstrapHostStatus().size();
int needBootstrapHostCount = -1;
if (addedHosts == null) {
needBootstrapHostCount = clusterDef.getNodes().size();
} else {
needBootstrapHostCount = addedHosts.size();
}
logger.debug("Need to bootstrap host number: " + needBootstrapHostCount);
logger.debug("Got bootstrap status number: " + bootstrapedHostCount);
if (needBootstrapHostCount != bootstrapedHostCount) {
success = false;
allHostsBootstrapped = false;
}
if (!success) {
List<String> notBootstrapNodes = new ArrayList<String>();
if (!allHostsBootstrapped) {
for (AmNodeDef node : clusterDef.getNodes()) {
boolean nodeBootstrapped = false;
for (ApiBootstrapHostStatus apiBootstrapHostStatus : apiBootstrapStatus
.getApiBootstrapHostStatus()) {
if (node.getFqdn().equals(
apiBootstrapHostStatus.getHostName())) {
nodeBootstrapped = true;
break;