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

undef not usable in collector search

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: PUP 4.2.2
    • Fix Version/s: PUP 4.6.0
    • Component/s: Language
    • Labels:
      None
    • Template:
    • Acceptance Criteria:
      Hide

      That a query such as

      Foo <| x == undef |> { x => 'baz' }
      

      matches instances of Foo with an undef x attribute.

      Show
      That a query such as Foo <| x == undef |> { x => 'baz' } matches instances of Foo with an undef x attribute.
    • Story Points:
      1
    • Sprint:
      Language 2016-07-27
    • CS Priority:
      Reviewed
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Using `undef` in a collector lead to an error. Literal `undef` can now be used in collector queries.

      Description

      The documentation for collector search expressions states that, for the equality search ==, undef is a valid right operand.

      However, when I try to use it, I get an Error: Evaluation Error: Error while evaluating a Virtual Query, Cannot transform object of class Puppet::Pops::Model::LiteralUndef error.

      Sample code:

      define foo (
        $x = undef ,
        $y = undef ,
      ) {
        notify { "foo::${x}::${y}": }
      }
       
      foo { 'bar': y => 'quux' }
      Foo <| x == undef |> { x => 'baz' }
      

      This is the result:

      $ puppet apply -t test.pp
      Info: Loading facts
      Info: Loading facts
      Error: Evaluation Error: Error while evaluating a Virtual Query, Cannot transform object of class Puppet::Pops::Model::LiteralUndef at …/test.pp:9:1 on node …
      

        Attachments

          Issue Links

            Activity

              jsd-sla-details-panel

                People

                • Assignee:
                  john.duarte John Duarte
                  Reporter:
                  JohnsonEarls Johnson Earls
                • Votes:
                  1 Vote for this issue
                  Watchers:
                  9 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: