Last change
on this file since 30903 was 30903, checked in by davidb, 7 years ago |
Vagrant provisioning files for a 4-node Hadoop cluster. See README.txt for more details
|
File size:
583 bytes
|
Line | |
---|
1 | module Puppet::Parser::Functions
|
---|
2 | newfunction(:dirname, :type => :rvalue, :doc => <<-EOS
|
---|
3 | Returns the dirname of a path.
|
---|
4 | EOS
|
---|
5 | ) do |arguments|
|
---|
6 |
|
---|
7 | if arguments.size < 1 then
|
---|
8 | raise(Puppet::ParseError, "dirname(): No arguments given")
|
---|
9 | end
|
---|
10 | if arguments.size > 1 then
|
---|
11 | raise(Puppet::ParseError, "dirname(): Too many arguments given (#{arguments.size})")
|
---|
12 | end
|
---|
13 | unless arguments[0].is_a?(String)
|
---|
14 | raise(Puppet::ParseError, 'dirname(): Requires string as argument')
|
---|
15 | end
|
---|
16 |
|
---|
17 | return File.dirname(arguments[0])
|
---|
18 | end
|
---|
19 | end
|
---|
20 |
|
---|
21 | # vim: set ts=2 sw=2 et :
|
---|
Note:
See
TracBrowser
for help on using the repository browser.