AMBARI-20648. Ambari Agent Distro/Conf Select Versions alert is not functioning correctly since missing format index when using Python 2.6 (alejandro)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/dca1ebd6 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/dca1ebd6 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/dca1ebd6 Branch: refs/heads/branch-feature-AMBARI-12556 Commit: dca1ebd6be1c3843afb074e6d03bdd53508e08a5 Parents: ba63ea3 Author: Alejandro Fernandez <[email protected]> Authored: Fri Mar 31 14:39:30 2017 -0700 Committer: Alejandro Fernandez <[email protected]> Committed: Mon Apr 3 16:19:44 2017 -0700 ---------------------------------------------------------------------- .../main/resources/host_scripts/alert_version_select.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/dca1ebd6/ambari-server/src/main/resources/host_scripts/alert_version_select.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/host_scripts/alert_version_select.py b/ambari-server/src/main/resources/host_scripts/alert_version_select.py index 118911f..0ce79e7 100644 --- a/ambari-server/src/main/resources/host_scripts/alert_version_select.py +++ b/ambari-server/src/main/resources/host_scripts/alert_version_select.py @@ -70,7 +70,7 @@ def execute(configurations={}, parameters={}, host_name=None): stack_tools_str = configurations[STACK_TOOLS] if stack_tools_str is None: - return (RESULT_STATE_UNKNOWN, ['{} is a required parameter for the script and the value is null'.format(STACK_TOOLS)]) + return (RESULT_STATE_UNKNOWN, ['{0} is a required parameter for the script and the value is null'.format(STACK_TOOLS)]) distro_select = "unknown-distro-select" try: @@ -87,18 +87,18 @@ def execute(configurations={}, parameters={}, host_name=None): (code, out, versions) = unsafe_get_stack_versions() if code == 0: - msg.append("Ok. {}".format(distro_select)) + msg.append("Ok. {0}".format(distro_select)) if versions is not None and type(versions) is list and len(versions) > 0: - msg.append("Versions: {}".format(", ".join(versions))) + msg.append("Versions: {0}".format(", ".join(versions))) return (RESULT_STATE_OK, ["\n".join(msg)]) else: - msg.append("Failed, check dir {} for unexpected contents.".format(stack_root_dir)) + msg.append("Failed, check dir {0} for unexpected contents.".format(stack_root_dir)) if out is not None: msg.append(out) return (RESULT_STATE_CRITICAL, ["\n".join(msg)]) else: - msg.append("Ok. No stack root {} to check.".format(stack_root_dir)) + msg.append("Ok. No stack root {0} to check.".format(stack_root_dir)) return (RESULT_STATE_OK, ["\n".join(msg)]) except Exception, e: return (RESULT_STATE_CRITICAL, [e.message])
