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

Ensure provider suitability is always lazily evaluated

    XMLWordPrintable

    Details

    • Template:
      PUP Bug Template
    • Team:
      Platform OS
    • Sprint:
      Platform OS Kanban
    • Method Found:
      Inspection
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      The upstart daemon-check confine in the upstart provider has been fixed so that it is now evaluated when provider suitability's being checked.
    • QA Risk Assessment:
      Needs Assessment

      Description

      Puppet::Provider::Service::Upstart had a confine added that is run when the provider is loaded.

        confine :true => begin
          initctl('version', '--quiet')
          true
        rescue
          false
        end
      

      This causes issues with running tests under things like JRuby, and also means that it is not possible for the provider to become suitable during the course of a transaction.  Instead of using a begin/rescue/end block which will be evaluated during the provider definition, this should be something that will be evaluated only when checking if the provider is suitable.
       

      This probably means creating a new type of Puppet::Confine that is capable of taking a block to be lazily evaluated as the only existing one that does any sort of "call this code later" goes through the feature machinery. We could also modify the existing true and false confines to optionally accept a block.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              enis.inan Enis Inan
              Reporter:
              jacob.helwig Jacob Helwig
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support