Puppet Function: shell_exports

Defined in:
modules/wmflib/lib/puppet/parser/functions/shell_exports.rb
Function type:
Ruby 3.x API

Overview

shell_exports()Any

Returns:

  • (Any)


25
26
27
28
29
30
# File 'modules/wmflib/lib/puppet/parser/functions/shell_exports.rb', line 25

newfunction(:shell_exports, :type => :rvalue, :arity => 1) do |args|
  vars, uppercase_keys = args
  fail(ArgumentError, 'validate_ensure(): hash argument required') unless vars.is_a?(Hash)
  vars = Hash[vars.map { |k, v| [k.upcase, v] }] unless uppercase_keys == false
  vars.sort.map { |k, v| "export #{k}=#{v.to_pson}" }.push('').join("\n")
end