You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by od...@apache.org on 2013/09/02 14:45:29 UTC
git commit: AMBARI-3061. Do not use regex to determine folder name by
full path for dfs_domain_socket_path. (Dmitry Sen via odiachenko)
Updated Branches:
refs/heads/trunk 2a8ea2bd6 -> dd33e55e5
AMBARI-3061. Do not use regex to determine folder name by full path for dfs_domain_socket_path. (Dmitry Sen via odiachenko)
Project: http://git-wip-us.apache.org/repos/asf/incubator-ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ambari/commit/dd33e55e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/dd33e55e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/dd33e55e
Branch: refs/heads/trunk
Commit: dd33e55e50e1779cc8a272015c9252ea5224e1df
Parents: 2a8ea2b
Author: Oleksandr Diachenko <od...@hortonworks.com>
Authored: Mon Sep 2 15:45:14 2013 +0300
Committer: Oleksandr Diachenko <od...@hortonworks.com>
Committed: Mon Sep 2 15:45:14 2013 +0300
----------------------------------------------------------------------
.../puppet/modules/hdp-hadoop/manifests/init.pp | 5 ++--
.../hdp_get_directory_from_filepath.rb | 31 ++++++++++++++++++++
2 files changed, 34 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/dd33e55e/ambari-agent/src/main/puppet/modules/hdp-hadoop/manifests/init.pp
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/puppet/modules/hdp-hadoop/manifests/init.pp b/ambari-agent/src/main/puppet/modules/hdp-hadoop/manifests/init.pp
index 793f477..bed41e9 100644
--- a/ambari-agent/src/main/puppet/modules/hdp-hadoop/manifests/init.pp
+++ b/ambari-agent/src/main/puppet/modules/hdp-hadoop/manifests/init.pp
@@ -268,10 +268,11 @@ class hdp-hadoop(
owner => 'root'
}
- $dfs_domain_socket_path_dir = regsubst($hdp-hadoop::params::dfs_domain_socket_path, '/[^\/]+$', '')
+ $dfs_domain_socket_path_dir = hdp_get_directory_from_filepath($hdp-hadoop::params::dfs_domain_socket_path)
hdp::directory_recursive_create { $dfs_domain_socket_path_dir:
owner => $hdfs_user,
- group => $hdp::params::user_group
+ group => $hdp::params::user_group,
+ mode => '0644'
}
#taskcontroller.cfg properties conditional on security
http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/dd33e55e/ambari-agent/src/main/puppet/modules/hdp/lib/puppet/parser/functions/hdp_get_directory_from_filepath.rb
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/puppet/modules/hdp/lib/puppet/parser/functions/hdp_get_directory_from_filepath.rb b/ambari-agent/src/main/puppet/modules/hdp/lib/puppet/parser/functions/hdp_get_directory_from_filepath.rb
new file mode 100644
index 0000000..aff6be3
--- /dev/null
+++ b/ambari-agent/src/main/puppet/modules/hdp/lib/puppet/parser/functions/hdp_get_directory_from_filepath.rb
@@ -0,0 +1,31 @@
+#
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+#
+#given file absolute path, return parent directory path
+
+module Puppet::Parser::Functions
+ newfunction(:hdp_get_directory_from_filepath, :type => :rvalue) do |args|
+ dir_path = ""
+ if args.length > 0
+ dir_path = File.split(args[0])[0]
+ end
+ dir_path
+ end
+end