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

Features are not being re-evaluated when a block is used

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • None
    • PUP 6.0.0
    • Docs, Types and Providers
    • None
    • Bug Fix
    • Hide
      Features defined using a block or a list of libraries now behave the same, so the following are equivalent:

      Puppet.features.add(:my_feature) do
        require 'mylib'
      end

      Puppet.features.add(:my_feature, libs: ['my_lib'])

      Previously the result of the block was always cached. With this change only true or false return values are cached. To indicate that the state of the feature is unknown and may become available later, the block should return nil.
      Show
      Features defined using a block or a list of libraries now behave the same, so the following are equivalent: Puppet.features.add(:my_feature) do   require 'mylib' end Puppet.features.add(:my_feature, libs: ['my_lib']) Previously the result of the block was always cached. With this change only true or false return values are cached. To indicate that the state of the feature is unknown and may become available later, the block should return nil.

    Description

      When a block is passed to the add method of Puppet::Util::Feature, it will only get evaluated once. This makes the "feature" feature practically unusable for anything except ruby libraries.

      Updated:

      Features should behave consistently when passed a block or an explicit list of ruby libraries. By default, they should not cache misses. If always_retry_plugins is false, then both block and non-block forms should cache misses, so that puppetserver doesn't try to reevaluate features.

      Attachments

        Issue Links

          Activity

            People

              josh Josh Cooper
              imriz Imri Zvik
              Votes:
              1 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support