incubator-ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vgog...@apache.org
Subject svn commit: r1336435 - /incubator/ambari/branches/ambari-186/hmc/puppet/modules/hdp/lib/puppet/parser/functions/hdp_host_attribute.rb
Date Wed, 09 May 2012 22:41:00 GMT
Author: vgogate
Date: Wed May  9 22:41:00 2012
New Revision: 1336435

URL: http://svn.apache.org/viewvc?rev=1336435&view=rev
Log:
AMBARI-200: External hostnames should be used for links on dashboard UI by Ramya

Added:
    incubator/ambari/branches/ambari-186/hmc/puppet/modules/hdp/lib/puppet/parser/functions/hdp_host_attribute.rb

Added: incubator/ambari/branches/ambari-186/hmc/puppet/modules/hdp/lib/puppet/parser/functions/hdp_host_attribute.rb
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/ambari-186/hmc/puppet/modules/hdp/lib/puppet/parser/functions/hdp_host_attribute.rb?rev=1336435&view=auto
==============================================================================
--- incubator/ambari/branches/ambari-186/hmc/puppet/modules/hdp/lib/puppet/parser/functions/hdp_host_attribute.rb
(added)
+++ incubator/ambari/branches/ambari-186/hmc/puppet/modules/hdp/lib/puppet/parser/functions/hdp_host_attribute.rb
Wed May  9 22:41:00 2012
@@ -0,0 +1,20 @@
+module Puppet::Parser::Functions
+  newfunction(:hdp_host_attribute, :type => :rvalue) do |args|
+    args = function_hdp_args_as_array(args)
+    hash,attr,source = args
+    ret_val = lambda do |hash,attr,s|
+      ret = ""
+      ndx = hash[s]
+      unless function_hdp_is_empty(ndx)
+        val = ndx[attr]
+        ret = function_hdp_is_empty(val) ? "" : val
+      end
+      ret
+    end
+    if source.kind_of?(Array)
+      source.map{|s|ret_val.call(hash,attr,s)}
+    else
+     ret_val.call(hash,attr,source)
+    end
+  end
+end



Mime
View raw message