Jira (PUP-9993) lookup's knockout_prefix cannot be undef, contrary to the documentation

15 views
Skip to first unread message

Fabien Wernli (JIRA)

unread,
Sep 3, 2019, 7:47:03 AM9/3/19
to puppe...@googlegroups.com
Fabien Wernli created an issue
 
Puppet / Bug PUP-9993
lookup's knockout_prefix cannot be undef, contrary to the documentation
Issue Type: Bug Bug
Affects Versions: PUP 6.7.0
Assignee: Unassigned
Components: Hiera & Lookup
Created: 2019/09/03 4:46 AM
Priority: Normal Normal
Reporter: Fabien Wernli

Puppet Version: 6.7.0
Puppet Server Version: N/A
OS Name/Version: Debian Buster

The documentation states at various places (e.g. https://puppet.com/docs/puppet/5.2/hiera_use_function.html) that lookup's knockout_prefix parameter is either a string or undef. However, when running puppet apply on the following code, we get an error:

 

 lookup(
{
'name' => 'foobar',
'value_type' => Hash,
'merge' =>

{ 'strategy' => 'deep', 'knockout_prefix' => undef, }

,
'default_value' => {},
},
)

 

Error: Evaluation Error: Error while evaluating a Function Call, 'lookup' expects one of:
(NameType = Variant[String, Array[String]] name, ValueType = Type value_type?, MergeType = Variant[String[1], Hash[String, Scalar]] merge?)
rejected: parameter 'name' expects a NameType = Variant[String, Array[String]] value, got Struct
(NameType = Variant[String, Array[String]] name, Optional[ValueType] value_type, Optional[MergeType] merge, DefaultValueType = Any default_value)
rejected: expects 4 arguments, got 1
(NameType = Variant[String, Array[String]] name, ValueType = Type value_type?, MergeType = Variant[String[1], Hash[String, Scalar]] merge?)
rejected: parameter 'name' expects a NameType = Variant[String, Array[String]] value, got Struct
(OptionsWithName = Struct[{'name' => NameType = Variant[String, Array[String]], 'value_type' => Optional[ValueType = Type], 'default_value' => DefaultValueType = Any, 'override' => Optional[Hash[String, Any]], 'default_values_hash' => Optional[Hash[String, Any]], 'merge' => Optional[MergeType = Variant[String[1], Hash[String, Scalar]]]}] options_hash, BlockType = Callable[NameType = Variant[String, Array[String]]] block?)
rejected: parameter 'options_hash' entry 'merge' variant 0 expects a String value, got Struct
rejected: parameter 'options_hash' entry 'merge' variant 1 entry 'knockout_prefix' expects a Scalar value, got Undef
(Variant[String, Array[String]] name, OptionsWithoutName = Struct[{'value_type' => Optional[ValueType = Type], 'default_value' => DefaultValueType = Any, 'override' => Optional[Hash[String, Any]], 'default_values_hash' => Optional[Hash[String, Any]], 'merge' => Optional[MergeType = Variant[String[1], Hash[String, Scalar]]]}] options_hash, BlockType = Callable[NameType = Variant[String, Array[String]]] block?)
rejected: expects 2 arguments, got 1 (file: /tmp/a.pp, line: 1, column: 6) on node node42.example.com

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Henrik Lindberg (JIRA)

unread,
Sep 3, 2019, 12:14:05 PM9/3/19
to puppe...@googlegroups.com
Henrik Lindberg commented on Bug PUP-9993
 
Re: lookup's knockout_prefix cannot be undef, contrary to the documentation

Fabien Wernli what is your expectations should happen when it is specified as `undef`?
I would assume it should treat it the same way as if no knockout prefix value was given at all...

Jorie Tappa (JIRA)

unread,
Sep 3, 2019, 2:30:03 PM9/3/19
to puppe...@googlegroups.com
Jorie Tappa commented on Bug PUP-9993

Jean Bond we suggest perhaps updating the linked documentation in the ticket to state that the `knockout_prefix` is disabled by default, instead of stating that it's set to undef, which may suggest users need to specify it as such in their code.

Jorie Tappa (JIRA)

unread,
Sep 3, 2019, 2:30:04 PM9/3/19
to puppe...@googlegroups.com

Fabien Wernli (JIRA)

unread,
Sep 5, 2019, 2:56:03 AM9/5/19
to puppe...@googlegroups.com
Fabien Wernli commented on Bug PUP-9993
 
Re: lookup's knockout_prefix cannot be undef, contrary to the documentation

My initial use-case was to parameterize a class with `$knockout_prefix` and `undef` would disable it.

Of course I can use a switch to enable/disable it, but this is still either a bug or a docbug.

Jean Bond (JIRA)

unread,
Sep 10, 2019, 1:20:03 PM9/10/19
to puppe...@googlegroups.com

Jorie Tappa (JIRA)

unread,
Oct 7, 2019, 2:44:02 PM10/7/19
to puppe...@googlegroups.com

Fabien Wernli (JIRA)

unread,
Jan 6, 2020, 8:05:03 AM1/6/20
to puppe...@googlegroups.com
Fabien Wernli commented on Bug PUP-9993
 
Re: lookup's knockout_prefix cannot be undef, contrary to the documentation

Here's what I found using the puppetlabs docs search interface:

 

So this is still in the latest documentation

Jean Bond (JIRA)

unread,
Jan 6, 2020, 11:58:03 AM1/6/20
to puppe...@googlegroups.com

Jean Bond (JIRA)

unread,
Jan 6, 2020, 11:58:03 AM1/6/20
to puppe...@googlegroups.com
Jean Bond assigned an issue to Unassigned
 
Change By: Jean Bond
Assignee: Jean Bond
Reply all
Reply to author
Forward
0 new messages