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 9CD9C200C10 for ; Fri, 3 Feb 2017 15:53:12 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 9B9F1160B48; Fri, 3 Feb 2017 14:53:12 +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 49E11160B6E for ; Fri, 3 Feb 2017 15:53:11 +0100 (CET) Received: (qmail 93061 invoked by uid 500); 3 Feb 2017 14:53:07 -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 91464 invoked by uid 99); 3 Feb 2017 14:53:06 -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; Fri, 03 Feb 2017 14:53:06 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 7F960E0A74; Fri, 3 Feb 2017 14:53:06 +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: Fri, 03 Feb 2017 14:53:52 -0000 Message-Id: In-Reply-To: <68fd00dbfa98457d890ae128ff26e2c7@git.apache.org> References: <68fd00dbfa98457d890ae128ff26e2c7@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [48/50] [abbrv] ambari git commit: AMBARI-19851. ambari-server start failed with exit code 1. (aonishuk) archived-at: Fri, 03 Feb 2017 14:53:12 -0000 AMBARI-19851. ambari-server start failed with exit code 1. (aonishuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/f2561c48 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/f2561c48 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/f2561c48 Branch: refs/heads/branch-dev-patch-upgrade Commit: f2561c48f71614d56fd747239cdd16bf5a6ef9ea Parents: 4ad3a2b Author: Andrew Onishuk Authored: Fri Feb 3 15:03:40 2017 +0200 Committer: Andrew Onishuk Committed: Fri Feb 3 15:03:40 2017 +0200 ---------------------------------------------------------------------- .../src/main/python/ambari_server/serverConfiguration.py | 9 +++++++-- ambari-server/src/main/python/ambari_server/serverSetup.py | 6 +++--- 2 files changed, 10 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/f2561c48/ambari-server/src/main/python/ambari_server/serverConfiguration.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/python/ambari_server/serverConfiguration.py b/ambari-server/src/main/python/ambari_server/serverConfiguration.py index ebd4807..c771b1e 100644 --- a/ambari-server/src/main/python/ambari_server/serverConfiguration.py +++ b/ambari-server/src/main/python/ambari_server/serverConfiguration.py @@ -207,6 +207,11 @@ REQUIRED_PROPERTIES = [OS_FAMILY_PROPERTY, OS_TYPE_PROPERTY, COMMON_SERVICES_PAT BOOTSTRAP_SETUP_AGENT_SCRIPT, STACKADVISOR_SCRIPT, BOOTSTRAP_DIR_PROPERTY, PID_DIR_PROPERTY, MPACKS_STAGING_PATH_PROPERTY] +# if these properties are available 'ambari-server setup -s' is not triggered again. +SETUP_DONE_PROPERTIES = [OS_FAMILY_PROPERTY, OS_TYPE_PROPERTY, JDK_NAME_PROPERTY, JDBC_DATABASE_PROPERTY, + NR_USER_PROPERTY, PERSISTENCE_TYPE_PROPERTY +] + def get_conf_dir(): try: conf_dir = os.environ[AMBARI_CONF_VAR] @@ -1461,9 +1466,9 @@ def get_server_temp_location(properties): server_tmp_dir = configDefaults.SERVER_TMP_DIR_DEFAULT return server_tmp_dir -def get_missing_properties(properties): +def get_missing_properties(properties, property_set=REQUIRED_PROPERTIES): missing_propertiers = [] - for property in REQUIRED_PROPERTIES: + for property in property_set: value = properties[property] if not value: missing_propertiers.append(property) http://git-wip-us.apache.org/repos/asf/ambari/blob/f2561c48/ambari-server/src/main/python/ambari_server/serverSetup.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/python/ambari_server/serverSetup.py b/ambari-server/src/main/python/ambari_server/serverSetup.py index adb5885..8a06034 100644 --- a/ambari-server/src/main/python/ambari_server/serverSetup.py +++ b/ambari-server/src/main/python/ambari_server/serverSetup.py @@ -37,11 +37,11 @@ from ambari_commons.os_utils import copy_files, run_os_command, is_root from ambari_commons.str_utils import compress_backslashes from ambari_server.dbConfiguration import DBMSConfigFactory, TAR_GZ_ARCHIVE_TYPE, default_connectors_map, check_jdbc_drivers from ambari_server.serverConfiguration import configDefaults, JDKRelease, \ - get_ambari_properties, get_is_secure, get_is_persisted, get_java_exe_path, get_JAVA_HOME, \ + get_ambari_properties, get_is_secure, get_is_persisted, get_java_exe_path, get_JAVA_HOME, get_missing_properties, \ get_resources_location, get_value_from_properties, read_ambari_user, update_properties, validate_jdk, write_property, \ JAVA_HOME, JAVA_HOME_PROPERTY, JCE_NAME_PROPERTY, JDBC_RCA_URL_PROPERTY, JDBC_URL_PROPERTY, \ JDK_NAME_PROPERTY, JDK_RELEASES, NR_USER_PROPERTY, OS_FAMILY, OS_FAMILY_PROPERTY, OS_TYPE, OS_TYPE_PROPERTY, OS_VERSION, \ - VIEWS_DIR_PROPERTY, JDBC_DATABASE_PROPERTY, JDK_DOWNLOAD_SUPPORTED_PROPERTY, JCE_DOWNLOAD_SUPPORTED_PROPERTY + VIEWS_DIR_PROPERTY, JDBC_DATABASE_PROPERTY, JDK_DOWNLOAD_SUPPORTED_PROPERTY, JCE_DOWNLOAD_SUPPORTED_PROPERTY, SETUP_DONE_PROPERTIES from ambari_server.serverUtils import is_server_runing from ambari_server.setupSecurity import adjust_directory_permissions from ambari_server.userInput import get_YN_input, get_validated_string_input @@ -1082,7 +1082,7 @@ def check_setup_already_done(): print_error_msg("Error getting ambari properties") return -1 - return properties.get_property(JDK_NAME_PROPERTY) and properties.get_property(JDBC_DATABASE_PROPERTY) + return not bool(get_missing_properties(properties, property_set=SETUP_DONE_PROPERTIES)) # # Setup the Ambari Server.