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

undefined method `from' for #<Puppet::Pops::Types::PStructType:0x6d4ca435>

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: PUP 5.0.1
    • Fix Version/s: PUP 5.2.0
    • Component/s: Language
    • Labels:
      None
    • Template:
    • Team:
      Platform Core
    • Method Found:
      Needs Assessment
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      A type mismatch involving an aliased Struct type would cause an "undefined method 'from'" error. This bug is now fixed.
    • QA Risk Assessment:
      Manual

      Description

      The problem occurs when including a class that might look like the following:

      class test (
        String $var,
        Test::Options $opts
      ) {
      }
      

      Let's assume that Test::Options is defined as:

      type Test::Options = Struct[{
        var => String
      }]
      

      If the 'var' parameter doesn't get passed to the test class, an evaluation error would be generated as expected. This works indeed.

      However, one would expected to see the same evaluation error popping up if var is not specified in the 'opts' hash, since it is required. Instead, the following error occurs:

      Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Method call, undefined method `from' for #<Puppet::Pops::Types::PStructType:0x6d4ca435>
      

      This problem does not occur when using puppet apply (masterless).

        Attachments

          Activity

            People

            Assignee:
            john.duarte John Duarte
            Reporter:
            matteo.cerutti Matteo Cerutti
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Zendesk Support