Puppet Function: accounts_parent_dir

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

Overview

accounts_parent_dir()Any

Return directory from path to file

Returns:

  • (Any)


2
3
4
5
6
7
8
9
10
11
12
13
# File 'lib/puppet/parser/functions/accounts_parent_dir.rb', line 2

newfunction(:accounts_parent_dir, :type => :rvalue, :doc => <<-EOS
Return directory from path to file
EOS
) do |args|

  if args.size != 1
    raise(Puppet::ParseError, "accounts_group_members(): Wrong number of args, given #{args.size}, accepts 1")
  end

  idx = args[0].rindex('/')
  return args[0][0...idx]
end