Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 59497200BB1 for ; Wed, 19 Oct 2016 18:47:17 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 580ED160B07; Wed, 19 Oct 2016 16:47:17 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id B1F2A160AFF for ; Wed, 19 Oct 2016 18:47:15 +0200 (CEST) Received: (qmail 22100 invoked by uid 500); 19 Oct 2016 16:47:13 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 21814 invoked by uid 99); 19 Oct 2016 16:47:13 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Oct 2016 16:47:13 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 506DEE0902; Wed, 19 Oct 2016 16:47:13 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ncole@apache.org To: commits@ambari.apache.org Date: Wed, 19 Oct 2016 16:47:45 -0000 Message-Id: <51cb20d4bb2b479e8a02ee5638facefb@git.apache.org> In-Reply-To: <8b2bc32f218d4cfda988b04b82f576f4@git.apache.org> References: <8b2bc32f218d4cfda988b04b82f576f4@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [34/50] [abbrv] ambari git commit: AMBARI-18608. Give a reasonable error message when oozie service_check fails due to nodocs docker option (aonishuk) archived-at: Wed, 19 Oct 2016 16:47:17 -0000 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-dev-patch-upgrade Commit: 41c49e162f156320a0c366f487beea0280b95e38 Parents: 5c32fed Author: Andrew Onishuk Authored: Mon Oct 17 16:18:52 2016 +0300 Committer: Andrew Onishuk 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,