Skip to content

Commit

Permalink
add docstring to ganglia_validate_clusters() function
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua Hoblitt committed May 16, 2014
1 parent 53988e9 commit 59d378d
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions lib/puppet/parser/functions/ganglia_validate_clusters.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,53 @@ module Puppet::Parser::Functions
newfunction(:ganglia_validate_clusters, :doc => <<-'ENDHEREDOC') do |args|
The following values will pass:
* [{ 'name' => 'my cluster', 'address' => 'localhost' }]
* [{ 'name' => 'my cluster', 'address' => 'localhost', 'polling_interval' => 10 }]
* [
{
'name' => 'foo',
'address' => [
'foo1.example.org',
'foo2.example.org',
'foo3.example.org',
],
},
{
'name' => 'bar',
'address' => [
'bar1.example.org',
'bar2.example.org',
'bar3.example.org'
],
'polling_interval' => 42,
},
{
'name' => 'baz',
'address' => [
'baz1.example.org',
'baz2.example.org',
'baz3.example.org',
],
},
]
The following values will fail, causing compilation to abort:
* true
* false
* {}
* 'foo'
* undef
* []
* ['foo', 'bar']
* [{}, {}]
* [{ 'address' => 'localhost' }]
* [{ 'name' => ['my cluster'], 'address' => 'localhost' }]
* [{ 'name' => 'my cluster' }]
* [{ 'name' => 'my cluster', 'address' => {'a' => 1} }]
* [{ 'name' => 'my cluster', 'address' => 'localhost', 'polling_interval' => [ 10 ] }]
* [{ 'name' => 'my cluster', 'address' => 'localhost', 'polling_interval' => 10, 'foo' => 1, 'bar' => 2 }]
ENDHEREDOC

Puppet::Parser::Functions.autoloader.loadall
Expand Down

0 comments on commit 59d378d

Please sign in to comment.