AMBARI-18608. Give a reasonable error message when oozie service_check fails due to nodocs docker option (aonishuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/41c49e16 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/41c49e16 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/41c49e16 Branch: refs/heads/branch-feature-AMBARI-18456 Commit: 41c49e162f156320a0c366f487beea0280b95e38 Parents: 5c32fed Author: Andrew Onishuk <aonis...@hortonworks.com> Authored: Mon Oct 17 16:18:52 2016 +0300 Committer: Andrew Onishuk <aonis...@hortonworks.com> Committed: Mon Oct 17 16:18:52 2016 +0300 ---------------------------------------------------------------------- .../OOZIE/4.0.0.2.0/package/scripts/service_check.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/41c49e16/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/service_check.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/service_check.py b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/service_check.py index 3710117..1a3ab08 100644 --- a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/service_check.py +++ b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/service_check.py @@ -31,6 +31,10 @@ from ambari_commons import OSConst from resource_management.core.logger import Logger +NO_DOCS_FOLDER_MESSAGE = "Cannot find {oozie_examples_regex}. Possible reason is that /etc/yum.conf contains" \ +" tsflags=nodocs which prevents this folder from being installed along with oozie-client package." \ +" If this is the case, please fix /etc/yum.conf and re-install the package." + class OozieServiceCheck(Script): pass @@ -61,7 +65,10 @@ class OozieServiceCheckDefault(OozieServiceCheck): ) os_family = System.get_instance().os_family - oozie_examples_dir = glob.glob(params.oozie_examples_regex)[0] + oozie_examples_dir_regex_matches = glob.glob(params.oozie_examples_regex) + if not oozie_examples_dir_regex_matches: + raise Fail(format(NO_DOCS_FOLDER_MESSAGE)) + oozie_examples_dir = oozie_examples_dir_regex_matches[0] Execute((format("{tmp_dir}/{prepare_hdfs_file_name}"), params.conf_dir, oozie_examples_dir, params.hadoop_conf_dir, params.yarn_resourcemanager_address, params.fs_root, params.service_check_queue_name), tries=3,