ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rle...@apache.org
Subject [10/24] ambari git commit: AMBARI-22465 Post-Upgrade Tasks Use the Wrong Repository and Hooks Folders (dgrinenko)
Date Wed, 29 Nov 2017 16:58:27 GMT
AMBARI-22465 Post-Upgrade Tasks Use the Wrong Repository and Hooks Folders (dgrinenko)


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

Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 82af6fb6d3f11476df203d9871cc978091891cfe
Parents: 020e152
Author: Dmytro Grinenko <hapylestat@apache.org>
Authored: Tue Nov 28 19:23:28 2017 +0200
Committer: Dmytro Grinenko <hapylestat@apache.org>
Committed: Tue Nov 28 19:25:28 2017 +0200

----------------------------------------------------------------------
 .../server/controller/internal/UpgradeResourceProvider.java  | 8 --------
 .../resources/custom_actions/scripts/ru_execute_tasks.py     | 5 +++--
 .../src/test/python/custom_actions/test_ru_execute_tasks.py  | 6 +++---
 3 files changed, 6 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/82af6fb6/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
index c5303cc..bab5369 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
@@ -1053,10 +1053,6 @@ public class UpgradeResourceProvider extends AbstractControllerResourceProvider
     // Apply additional parameters to the command that come from the stage.
     applyAdditionalParameters(wrapper, params);
 
-    // the ru_execute_tasks invokes scripts - it needs information about where
-    // the scripts live and for that it should always use the target repository
-    // stack
-    applyRepositoryAssociatedParameters(wrapper, effectiveRepositoryVersion.getStackId(),
params);
 
     // add each host to this stage
     RequestResourceFilter filter = new RequestResourceFilter(serviceName, componentName,
@@ -1204,10 +1200,6 @@ public class UpgradeResourceProvider extends AbstractControllerResourceProvider
     // Apply additional parameters to the command that come from the stage.
     applyAdditionalParameters(wrapper, commandParams);
 
-    // add things like hooks and service folders based on effective repo
-    applyRepositoryAssociatedParameters(wrapper, effectiveRepositoryVersion.getStackId(),
-        commandParams);
-
     ActionExecutionContext actionContext = new ActionExecutionContext(cluster.getClusterName(),
         "SERVICE_CHECK", filters, commandParams);
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/82af6fb6/ambari-server/src/main/resources/custom_actions/scripts/ru_execute_tasks.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/custom_actions/scripts/ru_execute_tasks.py b/ambari-server/src/main/resources/custom_actions/scripts/ru_execute_tasks.py
index c0f0d41..dff4ee1 100644
--- a/ambari-server/src/main/resources/custom_actions/scripts/ru_execute_tasks.py
+++ b/ambari-server/src/main/resources/custom_actions/scripts/ru_execute_tasks.py
@@ -102,8 +102,8 @@ class ExecuteUpgradeTasks(Script):
     version = default('/roleParams/version', None)
 
     # These 2 variables are optional
-    service_package_folder = default('/roleParams/service_package_folder', None)
-    hooks_folder = default('/roleParams/hooks_folder', None)
+    service_package_folder = default('/commandParams/service_package_folder', None)
+    hooks_folder = default('/commandParams/hooks_folder', None)
 
     tasks = json.loads(config['roleParams']['tasks'])
     if tasks:
@@ -154,5 +154,6 @@ class ExecuteUpgradeTasks(Script):
           task.command = replace_variables(task.command, host_name, version)
           shell.checked_call(task.command, logoutput=True, quiet=True)
 
+
 if __name__ == "__main__":
   ExecuteUpgradeTasks().execute()

http://git-wip-us.apache.org/repos/asf/ambari/blob/82af6fb6/ambari-server/src/test/python/custom_actions/test_ru_execute_tasks.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/custom_actions/test_ru_execute_tasks.py b/ambari-server/src/test/python/custom_actions/test_ru_execute_tasks.py
index 0d12a91..17d5e77 100644
--- a/ambari-server/src/test/python/custom_actions/test_ru_execute_tasks.py
+++ b/ambari-server/src/test/python/custom_actions/test_ru_execute_tasks.py
@@ -146,8 +146,8 @@ class TestRUExecuteTasks(RMFTestCase):
     with open(json_file_path, "r") as json_file:
       json_payload = json.load(json_file)
 
-    del json_payload['roleParams']['service_package_folder']
-    del json_payload['roleParams']['hooks_folder']
+    del json_payload['commandParams']['service_package_folder']
+    del json_payload['commandParams']['hooks_folder']
 
     config_dict = ConfigDictionary(json_payload)
 
@@ -166,7 +166,7 @@ class TestRUExecuteTasks(RMFTestCase):
     # Ensure that the json file was actually read.
     stack_name = default("/hostLevelParams/stack_name", None)
     stack_version = default("/hostLevelParams/stack_version", None)
-    service_package_folder = default('/roleParams/service_package_folder', None)
+    service_package_folder = default('/commandParams/service_package_folder', None)
 
     self.assertEqual(stack_name, "HDP")
     self.assertEqual(stack_version, '2.2')


Mime
View raw message