Details
-
Bug
-
Status: Resolved
-
Normal
-
Resolution: Fixed
-
None
-
None
-
None
-
Needs Assessment
-
Needs Assessment
Description
Basic Info
Module Version: 5.1.0
Puppet Version: 6.0.4 (Probably since 4.6.0
OS Name/Version: Mac (Probably all)
I want to verify that a class is defined with certain parameters.
if defined_with_params(Class[foo], { important => true, }) |
Desired Behavior:
The function should return a valid result.
Actual Behavior:
$ cat test.pp
|
class foo ( |
$bar = 'a', |
$baz = 'b', |
) {
|
}
|
|
class { 'foo': |
bar => 'q', |
baz => 'b', |
}
|
|
warning(defined_with_params(Class['foo'], { bar => 'q', baz => 'b' })) |
$ puppet apply --noop test.pp
|
Warning: Scope(Class[main]): false |
Notice: Compiled catalog for mbaur.syseleven.net in environment production in 0.05 seconds |
Notice: Applied catalog in 0.01 seconds |
It works, if the class is quoted:
$ cat test.pp
|
class foo ( |
$bar = 'a', |
$baz = 'b', |
) {
|
}
|
|
class { 'foo': |
bar => 'q', |
baz => 'b', |
}
|
|
warning(defined_with_params('Class[foo]', { bar => 'q', baz => 'b' })) |
$ puppet apply --noop test.pp
|
Warning: Scope(Class[main]): true |
Notice: Compiled catalog for mbaur.syseleven.net in environment production in 0.05 seconds |
Notice: Applied catalog in 0.01 seconds |