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

User type has custom retrieve() with non-standard return values

    XMLWordPrintable

Details

    • Night's Watch
    • 1
    • NW - 2020-02-05, NW - 2020-02-19, NW - 2020-03-04, NW - 2020-03-17, NW - 2020-04-01
    • Needs Assessment
    • Enhancement
    • Hide
      The user type has a long-standing custom retrieve() method which
      returns values not in keeping with the standard retrieve() from
      Puppet::Type.retrieve().
      This fix removes the custom method and adjusts the tests dependent on the particular behavior from
      it.
      Show
      The user type has a long-standing custom retrieve() method which returns values not in keeping with the standard retrieve() from Puppet::Type.retrieve(). This fix removes the custom method and adjusts the tests dependent on the particular behavior from it.
    • Needs Assessment

    Description

      The core user type has a custom retrieve() method which returns a Hash that is inconsistent with the data type returned by the common method in Puppet::Type.retrieve(). As a result, mechanisms expecting to use retrieve() will have problems with user resources.

      Here is the offending code in the user type: https://github.com/puppetlabs/puppet/blob/master/lib/puppet/type/user.rb#L496-L513

      I think it may be safe and desirable to just remove the user type's retrieve block and let the standard one take effect. The existing retrieve method seems to be 10+ years old and may just be an artifact of a much earlier time in Puppet's life.

      Regardless if the method is needed or not, it should have a return value consistent with the expected return value from the standard Puppet::Type.retrieve() method.

      Attachments

        Activity

          People

            dorin.pleava Dorin Pleava
            seanmil Sean Millichamp
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Zendesk Support