ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From srima...@apache.org
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 GMT
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 <sgunturi@hortonworks.com>
Authored: Wed Aug 12 17:46:23 2015 -0700
Committer: Srimanth Gunturi <sgunturi@hortonworks.com>
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.")


Mime
View raw message