You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by vb...@apache.org on 2014/01/08 13:38:30 UTC
git commit: AMBARI-4238. Unable to install hdp - puppet
error.(vbrodetskyi)
Updated Branches:
refs/heads/trunk 5e5d119d0 -> fb7348909
AMBARI-4238. Unable to install hdp - puppet error.(vbrodetskyi)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/fb734890
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/fb734890
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/fb734890
Branch: refs/heads/trunk
Commit: fb73489094de066c55222897a1b1e832980663ab
Parents: 5e5d119
Author: Vitaly Brodetskyi <vb...@hortonworks.com>
Authored: Wed Jan 8 14:37:25 2014 +0200
Committer: Vitaly Brodetskyi <vb...@hortonworks.com>
Committed: Wed Jan 8 14:37:45 2014 +0200
----------------------------------------------------------------------
.../parser/functions/hdp_str_ends_with.rb | 32 ++++++++++++++++++++
1 file changed, 32 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/fb734890/ambari-agent/src/main/puppet/modules/hdp/lib/puppet/parser/functions/hdp_str_ends_with.rb
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/puppet/modules/hdp/lib/puppet/parser/functions/hdp_str_ends_with.rb b/ambari-agent/src/main/puppet/modules/hdp/lib/puppet/parser/functions/hdp_str_ends_with.rb
new file mode 100644
index 0000000..d20f515
--- /dev/null
+++ b/ambari-agent/src/main/puppet/modules/hdp/lib/puppet/parser/functions/hdp_str_ends_with.rb
@@ -0,0 +1,32 @@
+#
+#
+# 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.
+#
+#
+module Puppet::Parser::Functions
+ newfunction(:hdp_str_ends_with, :type => :rvalue) do |args|
+ args = function_hdp_args_as_array(args)
+ if args.size >= 2
+ str = args[0]
+ substr = args[1]
+ result = str.end_with?(substr)
+ else
+ result = false
+ end
+ end
+end