Repository: ambari Updated Branches: refs/heads/trunk c7cbaf22e -> 978cc64e2
AMBARI-17275. All created views disappear after upgrade to 2.4.0.0 [views page].(Gaurav Nagar via dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/978cc64e Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/978cc64e Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/978cc64e Branch: refs/heads/trunk Commit: 978cc64e237c48e7d6bb8eac012c9fe33c93805e Parents: c7cbaf2 Author: Dipayan Bhowmick <[email protected]> Authored: Fri Jun 17 15:33:51 2016 +0530 Committer: Dipayan Bhowmick <[email protected]> Committed: Fri Jun 17 15:33:51 2016 +0530 ---------------------------------------------------------------------- .../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/978cc64e/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 b14aeed..e868f96 100644 --- a/ambari-server/src/main/python/ambari_server/serverConfiguration.py +++ b/ambari-server/src/main/python/ambari_server/serverConfiguration.py @@ -628,6 +628,14 @@ def get_admin_views_dir(properties): views_dirs = glob.glob(views_dir + "/work/ADMIN_VIEW*") return views_dirs +def get_views_jars(properties): + views_dir = properties.get_property(VIEWS_DIR_PROPERTY) + if views_dir is None or views_dir == "": + views_jars = glob.glob(AmbariPath.get("/var/lib/ambari-server/resources/views/*.jar")) + else: + views_jars = glob.glob(views_dir + "/*.jar") + return views_jars + def get_is_secure(properties): isSecure = properties.get_property(SECURITY_IS_ENCRYPTION_ENABLED) isSecure = True if isSecure and isSecure.lower() == 'true' else False http://git-wip-us.apache.org/repos/asf/ambari/blob/978cc64e/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 8bd7c51..d3cb3ba 100644 --- a/ambari-server/src/main/python/ambari_server/serverUpgrade.py +++ b/ambari-server/src/main/python/ambari_server/serverUpgrade.py @@ -37,7 +37,7 @@ from ambari_server.properties import Properties from ambari_server.serverConfiguration import configDefaults, get_resources_location, update_properties, \ check_database_name_property, get_ambari_properties, get_ambari_version, \ get_java_exe_path, get_stack_location, parse_properties_file, read_ambari_user, update_ambari_properties, \ - update_database_name_property, get_admin_views_dir, get_views_dir, \ + update_database_name_property, get_admin_views_dir, get_views_dir, get_views_jars, \ 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, update_ambari_env, \ AMBARI_ENV_FILE, JDBC_DATABASE_PROPERTY @@ -404,6 +404,11 @@ def upgrade(args): for admin_views_dir in admin_views_dirs: shutil.rmtree(admin_views_dir) + # Modify timestamp of views jars to current time + views_jars = get_views_jars(properties) + for views_jar in views_jars: + os.utime(views_jar, None) + # 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.")
