Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-9993

lookup's knockout_prefix cannot be undef, contrary to the documentation

    XMLWordPrintable

Details

    • Bug
    • Status: Ready for Engineering
    • Normal
    • Resolution: Unresolved
    • PUP 6.7.0
    • None
    • Docs, Hiera & Lookup
    • None
    • Coremunity
    • Needs Assessment
    • Needs Assessment

    Description

      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

      Attachments

        Activity

          People

            Unassigned Unassigned
            faxmodem Fabien Wernli
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:

              Zendesk Support