AMBARI-13265: [PluggableStackDefinition] Update templates and shell scripts (jluniya)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/c8ea8573 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c8ea8573 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c8ea8573 Branch: refs/heads/branch-dev-patch-upgrade Commit: c8ea8573a5b0c37dd467892be3e4774b4b01de20 Parents: 02c74c8 Author: Jayush Luniya <[email protected]> Authored: Mon Sep 28 22:29:31 2015 -0700 Committer: Jayush Luniya <[email protected]> Committed: Mon Sep 28 22:29:31 2015 -0700 ---------------------------------------------------------------------- .../GenerateStackDefinition.py | 17 +++++++++++++++-- .../pluggable_stack_definition/configs/PHD.json | 2 +- .../pluggable_stack_definition/configs/SAPHD.json | 2 +- 3 files changed, 17 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/c8ea8573/ambari-common/src/main/python/pluggable_stack_definition/GenerateStackDefinition.py ---------------------------------------------------------------------- diff --git a/ambari-common/src/main/python/pluggable_stack_definition/GenerateStackDefinition.py b/ambari-common/src/main/python/pluggable_stack_definition/GenerateStackDefinition.py index f1f9381..3038f90 100644 --- a/ambari-common/src/main/python/pluggable_stack_definition/GenerateStackDefinition.py +++ b/ambari-common/src/main/python/pluggable_stack_definition/GenerateStackDefinition.py @@ -369,6 +369,9 @@ def process_py_files(file_path, config_data, stack_version_changes): def process_xml_files(file_path, config_data, stack_version_changes): return process_replacements(file_path, config_data, stack_version_changes) +def process_other_files(file_path, config_data, stack_version_changes): + return process_replacements(file_path, config_data, stack_version_changes) + def process_config_xml(file_path, config_data): tree = ET.parse(file_path) root = tree.getroot() @@ -520,6 +523,11 @@ class GeneratorHelper(object): ################################################################### target = process_py_files(target, self.config_data, self.stack_version_changes) return + #################################################################### + # Generic processing for all other types of files. + #################################################################### + if target.endswith(".j2") or target.endswith(".sh"): + process_other_files(target, self.config_data, self.stack_version_changes) copy_tree(original_stack, target_stack, ignored_files, post_copy=post_copy) # copy default stack advisor @@ -542,12 +550,17 @@ class GeneratorHelper(object): # process configuration xml target = process_config_xml(target, self.config_data) # process generic xml - if target.endswith('.xml'): - process_xml_files(target, self.config_data, self.stack_version_changes) + process_xml_files(target, self.config_data, self.stack_version_changes) + return # process python files if target.endswith('.py'): process_py_files(target, self.config_data, self.stack_version_changes) return + #################################################################### + # Generic processing for all other types of files. + #################################################################### + if target.endswith(".j2") or target.endswith(".sh"): + process_other_files(target, self.config_data, self.stack_version_changes) copy_tree(source_folder, target_folder, ignored_files, post_copy=post_copy) if parent_services: http://git-wip-us.apache.org/repos/asf/ambari/blob/c8ea8573/ambari-common/src/main/python/pluggable_stack_definition/configs/PHD.json ---------------------------------------------------------------------- diff --git a/ambari-common/src/main/python/pluggable_stack_definition/configs/PHD.json b/ambari-common/src/main/python/pluggable_stack_definition/configs/PHD.json index 45e45be..431a26c 100644 --- a/ambari-common/src/main/python/pluggable_stack_definition/configs/PHD.json +++ b/ambari-common/src/main/python/pluggable_stack_definition/configs/PHD.json @@ -5,7 +5,7 @@ "textReplacements": [ ["hdp-select", "distro-select"] ], - "preservedText": ["ext-2.2", "HDP-oozie", "hdp.version", "HDP_VERSION"], + "preservedText": ["ext-2.2", "HDP-oozie", "hdp.version", "HDP_VERSION", "192.168."], "uiMapping": [ { "stackVersionNumber": "3.0", http://git-wip-us.apache.org/repos/asf/ambari/blob/c8ea8573/ambari-common/src/main/python/pluggable_stack_definition/configs/SAPHD.json ---------------------------------------------------------------------- diff --git a/ambari-common/src/main/python/pluggable_stack_definition/configs/SAPHD.json b/ambari-common/src/main/python/pluggable_stack_definition/configs/SAPHD.json index 27c6995..de85ade 100644 --- a/ambari-common/src/main/python/pluggable_stack_definition/configs/SAPHD.json +++ b/ambari-common/src/main/python/pluggable_stack_definition/configs/SAPHD.json @@ -5,7 +5,7 @@ "textReplacements": [ ["hdp-select", "distro-select"] ], - "preservedText": ["ext-2.2", "HDP-oozie", "hdp.version", "HDP_VERSION"], + "preservedText": ["ext-2.2", "HDP-oozie", "hdp.version", "HDP_VERSION", "192.168."], "uiMapping": [ { "stackVersionNumber": "1.0",
