Repository: ambari Updated Branches: refs/heads/trunk 46c802dae -> 9085d9ee6
AMBARI-11168 Zookeeper implicitly depends on HDFS Client (dsen) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/9085d9ee Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/9085d9ee Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/9085d9ee Branch: refs/heads/trunk Commit: 9085d9ee66e6f2d174415c26213ba1ce6ec01817 Parents: 46c802d Author: Dmytro Sen <[email protected]> Authored: Fri May 15 18:11:51 2015 +0300 Committer: Dmytro Sen <[email protected]> Committed: Fri May 15 18:13:27 2015 +0300 ---------------------------------------------------------------------- .../hooks/before-INSTALL/scripts/params.py | 4 +- .../2.0.6/hooks/before-START/scripts/params.py | 5 +- .../scripts/shared_initialization.py | 62 ++++++++++---------- 3 files changed, 37 insertions(+), 34 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/9085d9ee/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-INSTALL/scripts/params.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-INSTALL/scripts/params.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-INSTALL/scripts/params.py index c8ac180..b205f39 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-INSTALL/scripts/params.py +++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-INSTALL/scripts/params.py @@ -19,8 +19,10 @@ limitations under the License. from ambari_commons.constants import AMBARI_SUDO_BINARY from resource_management.libraries.functions.version import format_hdp_stack_version, compare_versions -from resource_management import * from resource_management.core.system import System +from resource_management.libraries.script.script import Script +from resource_management.libraries.functions import default, format + import json import collections http://git-wip-us.apache.org/repos/asf/ambari/blob/9085d9ee/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/params.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/params.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/params.py index 6f5f666..889dbd1 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/params.py +++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/params.py @@ -17,11 +17,10 @@ limitations under the License. """ -from resource_management.libraries.functions import conf_select +from resource_management.libraries.functions import conf_select, default, format_jvm_option, format from resource_management.libraries.functions.version import format_hdp_stack_version, compare_versions from ambari_commons.os_check import OSCheck -from resource_management import * -from resource_management.core.system import System +from resource_management.libraries.script.script import Script import os config = Script.get_config() http://git-wip-us.apache.org/repos/asf/ambari/blob/9085d9ee/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/shared_initialization.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/shared_initialization.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/shared_initialization.py index 70bd011..dd93818 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/shared_initialization.py +++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/shared_initialization.py @@ -62,37 +62,38 @@ def setup_hadoop(): else: tc_owner = params.hdfs_user - File(os.path.join(params.hadoop_conf_dir, 'commons-logging.properties'), - owner=tc_owner, - content=Template('commons-logging.properties.j2') - ) - - health_check_template_name = "health_check" - File(os.path.join(params.hadoop_conf_dir, health_check_template_name), - owner=tc_owner, - content=Template(health_check_template_name + ".j2") - ) + if os.path.exists(params.hadoop_conf_dir): + File(os.path.join(params.hadoop_conf_dir, 'commons-logging.properties'), + owner=tc_owner, + content=Template('commons-logging.properties.j2') + ) - log4j_filename = os.path.join(params.hadoop_conf_dir, "log4j.properties") - if (params.log4j_props != None): - File(log4j_filename, - mode=0644, - group=params.user_group, - owner=params.hdfs_user, - content=params.log4j_props + health_check_template_name = "health_check" + File(os.path.join(params.hadoop_conf_dir, health_check_template_name), + owner=tc_owner, + content=Template(health_check_template_name + ".j2") ) - elif (os.path.exists(format("{params.hadoop_conf_dir}/log4j.properties"))): - File(log4j_filename, - mode=0644, - group=params.user_group, + + log4j_filename = os.path.join(params.hadoop_conf_dir, "log4j.properties") + if (params.log4j_props != None): + File(log4j_filename, + mode=0644, + group=params.user_group, + owner=params.hdfs_user, + content=params.log4j_props + ) + elif (os.path.exists(format("{params.hadoop_conf_dir}/log4j.properties"))): + File(log4j_filename, + mode=0644, + group=params.user_group, + owner=params.hdfs_user, + ) + + File(os.path.join(params.hadoop_conf_dir, "hadoop-metrics2.properties"), owner=params.hdfs_user, + content=Template("hadoop-metrics2.properties.j2") ) - File(os.path.join(params.hadoop_conf_dir, "hadoop-metrics2.properties"), - owner=params.hdfs_user, - content=Template("hadoop-metrics2.properties.j2") - ) - def setup_database(): """ Load DB @@ -118,10 +119,11 @@ def setup_configs(): import params if params.has_namenode: - File(params.task_log4j_properties_location, - content=StaticFile("task-log4j.properties"), - mode=0755 - ) + if os.path.exists(params.hadoop_conf_dir): + File(params.task_log4j_properties_location, + content=StaticFile("task-log4j.properties"), + mode=0755 + ) if os.path.exists(os.path.join(params.hadoop_conf_dir, 'configuration.xsl')): File(os.path.join(params.hadoop_conf_dir, 'configuration.xsl'),
