You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by al...@apache.org on 2015/05/14 05:29:46 UTC
ambari git commit: AMBARI-11121. Oozie Service Check fails because
folders in /user/ambari-qa are owned by hdfs:hdfs (alejandro)
Repository: ambari
Updated Branches:
refs/heads/trunk 9fab4435c -> c20250c5c
AMBARI-11121. Oozie Service Check fails because folders in /user/ambari-qa are owned by hdfs:hdfs (alejandro)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/c20250c5
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c20250c5
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c20250c5
Branch: refs/heads/trunk
Commit: c20250c5c20db43fcbd71fc9f76bcce8624c3fba
Parents: 9fab443
Author: Alejandro Fernandez <af...@hortonworks.com>
Authored: Wed May 13 20:12:39 2015 -0700
Committer: Alejandro Fernandez <af...@hortonworks.com>
Committed: Wed May 13 20:12:39 2015 -0700
----------------------------------------------------------------------
.../4.0.0.2.0/package/scripts/service_check.py | 25 ++++++++++++++++----
.../stacks/2.0.6/OOZIE/test_service_check.py | 24 +++++++++++++++++++
2 files changed, 44 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/c20250c5/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/service_check.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/service_check.py b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/service_check.py
index a2195d8..11f4431 100644
--- a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/service_check.py
+++ b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/service_check.py
@@ -59,22 +59,37 @@ class OozieServiceCheckDefault(OozieServiceCheck):
os_family = System.get_instance().os_family
oozie_examples_dir = glob.glob(params.oozie_examples_regex)[0]
-
+
Execute(format("{tmp_dir}/{prepare_hdfs_file_name} {conf_dir} {oozie_examples_dir} {hadoop_conf_dir} "),
tries=3,
try_sleep=5,
logoutput=True
)
-
- params.HdfsResource(format('/user/{smokeuser}/examples'),
+
+ examples_dir = format('/user/{smokeuser}/examples')
+ params.HdfsResource(examples_dir,
+ action = "delete_on_execute",
+ type = "directory"
+ )
+ params.HdfsResource(examples_dir,
action = "create_on_execute",
type = "directory",
source = format("{oozie_examples_dir}/examples"),
+ owner = params.smokeuser,
+ group = params.user_group
)
- params.HdfsResource(format('/user/{smokeuser}/input-data'),
+
+ input_data_dir = format('/user/{smokeuser}/input-data')
+ params.HdfsResource(input_data_dir,
+ action = "delete_on_execute",
+ type = "directory"
+ )
+ params.HdfsResource(input_data_dir,
action = "create_on_execute",
type = "directory",
source = format("{oozie_examples_dir}/examples/input-data"),
+ owner = params.smokeuser,
+ group = params.user_group
)
params.HdfsResource(None, action="execute")
@@ -84,7 +99,7 @@ class OozieServiceCheckDefault(OozieServiceCheck):
else:
sh_cmd = format(
"{tmp_dir}/{file_name} {os_family} {oozie_lib_dir} {conf_dir} {oozie_bin_dir} {oozie_examples_dir} {hadoop_conf_dir} {hadoop_bin_dir} {smokeuser} {security_enabled}")
-
+
Execute(sh_cmd,
path=params.execute_path,
tries=3,
http://git-wip-us.apache.org/repos/asf/ambari/blob/c20250c5/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_service_check.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_service_check.py b/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_service_check.py
index 151ce14..54c85e4 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_service_check.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_service_check.py
@@ -70,11 +70,33 @@ class TestServiceCheck(RMFTestCase):
hadoop_bin_dir = '/usr/bin',
keytab = UnknownConfigurationMock(),
kinit_path_local = '/usr/bin/kinit',
+ user = 'hdfs',
+ action = ['delete_on_execute'],
+ hadoop_conf_dir = '/etc/hadoop/conf',
+ type = 'directory',
+ )
+ self.assertResourceCalled('HdfsResource', '/user/ambari-qa/examples',
+ security_enabled = False,
+ hadoop_bin_dir = '/usr/bin',
+ keytab = UnknownConfigurationMock(),
+ kinit_path_local = '/usr/bin/kinit',
source = '//examples',
user = 'hdfs',
action = ['create_on_execute'],
hadoop_conf_dir = '/etc/hadoop/conf',
type = 'directory',
+ owner = 'ambari-qa',
+ group = 'hadoop'
+ )
+ self.assertResourceCalled('HdfsResource', '/user/ambari-qa/input-data',
+ security_enabled = False,
+ hadoop_bin_dir = '/usr/bin',
+ keytab = UnknownConfigurationMock(),
+ kinit_path_local = '/usr/bin/kinit',
+ user = 'hdfs',
+ action = ['delete_on_execute'],
+ hadoop_conf_dir = '/etc/hadoop/conf',
+ type = 'directory',
)
self.assertResourceCalled('HdfsResource', '/user/ambari-qa/input-data',
security_enabled = False,
@@ -86,6 +108,8 @@ class TestServiceCheck(RMFTestCase):
action = ['create_on_execute'],
hadoop_conf_dir = '/etc/hadoop/conf',
type = 'directory',
+ owner = 'ambari-qa',
+ group = 'hadoop'
)
self.assertResourceCalled('HdfsResource', None,
security_enabled = False,