Puppet Function: validate_rd_policy

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

Overview

validate_rd_policy()Any

Returns:

  • (Any)


9
10
11
12
13
14
15
16
17
18
# File 'lib/puppet/parser/functions/validate_rd_policy.rb', line 9

Puppet::Parser::Functions.newfunction(:validate_rd_policy, doc: '') do |args|
  raise Puppet::ParseError, "validate_rd_policy(): wrong number of arguments (#{args.length}; must be 1)" unless args.length == 1

  args.each do |arg|
    next if arg.is_a?(Array)
    return PuppetX::Rundeck::ACL.validate_acl(arg) if arg.is_a?(Hash)

    raise Puppet::ParseError, "#{arg.inspect} is not a Hash or Array of hashes.  It looks to be a #{arg.class}"
  end
end