Repository: ambari Updated Branches: refs/heads/trunk 1eb9315d1 -> aa6ef089b
AMBARI-10313. RU: Replacement text not seen in pre-req check (dlysnichenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/aa6ef089 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/aa6ef089 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/aa6ef089 Branch: refs/heads/trunk Commit: aa6ef089ba16f4841c6af0666cc5d5d4b451df3d Parents: 1eb9315 Author: Lisnichenko Dmitro <[email protected]> Authored: Wed Apr 1 18:50:31 2015 +0300 Committer: Lisnichenko Dmitro <[email protected]> Committed: Wed Apr 1 19:01:44 2015 +0300 ---------------------------------------------------------------------- .../ambari/server/checks/AbstractCheckDescriptor.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/aa6ef089/ambari-server/src/main/java/org/apache/ambari/server/checks/AbstractCheckDescriptor.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/checks/AbstractCheckDescriptor.java b/ambari-server/src/main/java/org/apache/ambari/server/checks/AbstractCheckDescriptor.java index 283b24b..0666df7 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/checks/AbstractCheckDescriptor.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/checks/AbstractCheckDescriptor.java @@ -126,13 +126,14 @@ public abstract class AbstractCheckDescriptor { PrerequisiteCheck prerequisiteCheck, PrereqCheckRequest request) { String fail = m_description.getFail(key); - if (-1 != fail.indexOf("{{version}}") && null != request.getRepositoryVersion()) { + if (fail.contains("{{version}}") && null != request.getRepositoryVersion()) { fail = fail.replace("{{version}}", request.getRepositoryVersion()); } - if (-1 != fail.indexOf("{{fails}}")) { + if (fail.contains("{{fails}}")) { List<String> names = prerequisiteCheck.getFailedOn(); + // If Type=PrereqCheckType.HOST, names list is already populated if (getDescription().getType() == PrereqCheckType.SERVICE) { Clusters clusters = clustersProvider.get(); AmbariMetaInfo metaInfo = ambariMetaInfo.get(); @@ -155,12 +156,9 @@ public abstract class AbstractCheckDescriptor { } catch (Exception e) { LOG.warn("Could not load service info map"); } - - fail = fail.replace("{{fails}}", formatEntityList(names)); - } - + fail = fail.replace("{{fails}}", formatEntityList(names)); } return fail;
