You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by vb...@apache.org on 2015/06/30 15:58:27 UTC

ambari git commit: Revert "AMBARI-12101. Ambari : upgrading from 2.0.0 to 2.0.1 wipes out the added service folder on the stack.(vbrodetskyi)"

Repository: ambari
Updated Branches:
  refs/heads/trunk c14454419 -> 6d3633c44


Revert "AMBARI-12101. Ambari : upgrading from 2.0.0 to 2.0.1 wipes out the added service folder on the stack.(vbrodetskyi)"

This reverts commit 67f52acee027d08faf7e4ae346b080711ac7cb3d.


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/6d3633c4
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/6d3633c4
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/6d3633c4

Branch: refs/heads/trunk
Commit: 6d3633c442497ba5cea407dacf0a397dd38431f7
Parents: c144544
Author: Vitaly Brodetskyi <vb...@hortonworks.com>
Authored: Tue Jun 30 16:57:42 2015 +0300
Committer: Vitaly Brodetskyi <vb...@hortonworks.com>
Committed: Tue Jun 30 16:57:42 2015 +0300

----------------------------------------------------------------------
 .../main/python/ambari_server/serverUpgrade.py  | 49 --------------------
 1 file changed, 49 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/6d3633c4/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 abd9e84..f446fd6 100644
--- a/ambari-server/src/main/python/ambari_server/serverUpgrade.py
+++ b/ambari-server/src/main/python/ambari_server/serverUpgrade.py
@@ -24,8 +24,6 @@ import sys
 import shutil
 import base64
 import urllib2
-import re
-import glob
 
 from ambari_commons.exceptions import FatalException
 from ambari_commons.logging_utils import print_info_msg, print_warning_msg, print_error_msg, get_verbose
@@ -294,7 +292,6 @@ def upgrade(args):
     err = AMBARI_KRB_JAAS_LOGIN_FILE + ' file can\'t be updated. Exiting'
     raise FatalException(retcode, err)
 
-  restore_custom_services()
   try:
     update_database_name_property(upgrade=True)
   except FatalException:
@@ -411,52 +408,6 @@ def set_current(options):
   sys.stdout.write('\n')
   sys.stdout.flush()
 
-#
-# Search for folders with custom services and restore them from backup
-#
-def restore_custom_services():
-  properties = get_ambari_properties()
-  if properties == -1:
-    err = "Error getting ambari properties"
-    print_error_msg(err)
-    raise FatalException(-1, err)
-
-  try:
-    resources_dir = properties[RESOURCES_DIR_PROPERTY]
-  except (KeyError), e:
-    conf_file = properties.fileName
-    err = 'Property ' + str(e) + ' is not defined at ' + conf_file
-    print_error_msg(err)
-    raise FatalException(1, err)
-
-  services = glob.glob(os.path.join(resources_dir,"stacks","*","*","services","*"))
-  managed_services = []
-  for service in services:
-    if os.path.isdir(service) and not os.path.basename(service) in managed_services:
-      managed_services.append(os.path.basename(service))
-  # add deprecated managed services
-  managed_services.extend(["NAGIOS","GANGLIA","MAPREDUCE"])
-
-  stack_backup_dirs = glob.glob(os.path.join(resources_dir,"stacks_*.old"))
-  if stack_backup_dirs:
-    last_backup_dir = max(stack_backup_dirs, key=os.path.getctime)
-    backup_services = glob.glob(os.path.join(last_backup_dir,"*","*","services","*"))
-
-    regex = re.compile(r'/stacks.*old/')
-    for backup_service in backup_services:
-      backup_base_service_dir = os.path.dirname(backup_service)
-      current_base_service_dir = regex.sub('/stacks/', backup_base_service_dir)
-      # if services dir does not exists, we do not manage this stack
-      if not os.path.exists(current_base_service_dir):
-        continue
-
-      # process dirs only
-      if os.path.isdir(backup_service):
-        service_name = os.path.basename(backup_service)
-        if not service_name in managed_services:
-          shutil.copytree(backup_service, os.path.join(current_base_service_dir,service_name))
-
-
 
 class SetCurrentVersionOptions:
   def __init__(self, options):