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

remove dead code in Puppet::Type::instances

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PUP 5.0.0
    • Component/s: None
    • Labels:
      None
    • Template:
    • Team:
      Agent
    • Story Points:
      1
    • Sprint:
      Agent 2017-05-03, Agent 2017-05-31
    • Release Notes:
      Not Needed
    • Release Notes Summary:
      refactoring of code / pruning dead code
    • QA Risk Assessment:
      No Action
    • QA Risk Assessment Reason:
      Refactor

      Description

      This block in Puppet::Type: https://github.com/puppetlabs/puppet/blob/master/lib/puppet/type.rb#L1163-L1168 iterates over all of the properties of the type, checks if the given provider supports the property, and returns an array of all the supported property names.

      Except we don't do anything with the result.

      Before commit http://github.com/puppetlabs/puppet/commit/53241a91, which was a maint commit to remove superfluous variables we never used, the result of this block was assigned to the variable `all_properties` - which was never used. The commit removed the variable, but not the associated block.

      I believe the intention was to filter out properties that weren't supported by the provider before we called `newattr` on them, except `newattr` https://github.com/puppetlabs/puppet/blob/master/lib/puppet/type.rb#L769-L773 already does this filtering, and provides helpful debug output that a provider doesn't support a property so we're not managing it.

      The block can be removed.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            moses Moses Mendoza
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Zendesk Support