Return-Path: X-Original-To: apmail-ambari-commits-archive@www.apache.org Delivered-To: apmail-ambari-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8D2F018B3B for ; Thu, 13 Aug 2015 00:47:50 +0000 (UTC) Received: (qmail 32399 invoked by uid 500); 13 Aug 2015 00:47:50 -0000 Delivered-To: apmail-ambari-commits-archive@ambari.apache.org Received: (qmail 32370 invoked by uid 500); 13 Aug 2015 00:47:50 -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 32361 invoked by uid 99); 13 Aug 2015 00:47:50 -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; Thu, 13 Aug 2015 00:47:50 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 34FF3E0332; Thu, 13 Aug 2015 00:47:50 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: srimanth@apache.org To: commits@ambari.apache.org Message-Id: <241d3bfe9b7643e187ad1ad416800f68@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: ambari git commit: AMBARI-12747. Ambari server upgrade does not re-extract the jar content of the views (Rohit Choudhary via srimanth) Date: Thu, 13 Aug 2015 00:47:50 +0000 (UTC) Repository: ambari Updated Branches: refs/heads/trunk cef6f49b5 -> 6dc98001f AMBARI-12747. Ambari server upgrade does not re-extract the jar content of the views (Rohit Choudhary via srimanth) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/6dc98001 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/6dc98001 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/6dc98001 Branch: refs/heads/trunk Commit: 6dc98001f283b9eb0c52b9f47854ec4449f9ee89 Parents: cef6f49 Author: Srimanth Gunturi Authored: Wed Aug 12 17:46:23 2015 -0700 Committer: Srimanth Gunturi Committed: Wed Aug 12 17:47:38 2015 -0700 ---------------------------------------------------------------------- .../src/main/python/ambari_server/serverConfiguration.py | 8 ++++++++ ambari-server/src/main/python/ambari_server/serverUpgrade.py | 7 ++++++- 2 files changed, 14 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/6dc98001/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 7f4fe87..74d31d5 100644 --- a/ambari-server/src/main/python/ambari_server/serverConfiguration.py +++ b/ambari-server/src/main/python/ambari_server/serverConfiguration.py @@ -519,6 +519,14 @@ def get_value_from_properties(properties, key, default=""): return default return value +def get_views_dir(properties): + views_dir = properties.get_property(VIEWS_DIR_PROPERTY) + if views_dir is None or views_dir == "": + views_dirs = glob.glob("/var/lib/ambari-server/resources/views/work") + else: + views_dirs = glob.glob(views_dir + "/work") + return views_dirs + def get_admin_views_dir(properties): views_dir = properties.get_property(VIEWS_DIR_PROPERTY) if views_dir is None or views_dir == "": http://git-wip-us.apache.org/repos/asf/ambari/blob/6dc98001/ambari-server/src/main/python/ambari_server/serverUpgrade.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/python/ambari_server/serverUpgrade.py b/ambari-server/src/main/python/ambari_server/serverUpgrade.py index 2ab4c94..c22ac7c 100644 --- a/ambari-server/src/main/python/ambari_server/serverUpgrade.py +++ b/ambari-server/src/main/python/ambari_server/serverUpgrade.py @@ -35,7 +35,7 @@ from ambari_server.properties import Properties from ambari_server.serverConfiguration import configDefaults, \ check_database_name_property, get_ambari_properties, get_ambari_version, get_full_ambari_classpath, \ get_java_exe_path, get_stack_location, parse_properties_file, read_ambari_user, update_ambari_properties, \ - update_database_name_property, get_admin_views_dir, \ + update_database_name_property, get_admin_views_dir, get_views_dir,\ AMBARI_PROPERTIES_FILE, IS_LDAP_CONFIGURED, LDAP_PRIMARY_URL_PROPERTY, RESOURCES_DIR_PROPERTY, \ SETUP_OR_UPGRADE_MSG, update_krb_jaas_login_properties, AMBARI_KRB_JAAS_LOGIN_FILE, get_db_type from ambari_server.setupSecurity import adjust_directory_permissions, \ @@ -350,6 +350,11 @@ def upgrade(args): for admin_views_dir in admin_views_dirs: shutil.rmtree(admin_views_dir) + # Remove ambari views directory for the rest of the jars, at the time of upgrade. At restart all jars present in Ambari will be extracted into work directory + views_dir = get_views_dir(properties) + for views in views_dir: + shutil.rmtree(views) + # check if ambari has obsolete LDAP configuration if properties.get_property(LDAP_PRIMARY_URL_PROPERTY) and not properties.get_property(IS_LDAP_CONFIGURED): args.warnings.append("Existing LDAP configuration is detected. You must run the \"ambari-server setup-ldap\" command to adjust existing LDAP configuration.")