Uploaded image for project: 'Modules'
  1. Modules
  2. MODULES-11070

dsc_lite : Handle a missing ruby-pwsh

    XMLWordPrintable

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • dsc_lite, powershell
    • None
    • MODULES Bug Template
    • Modules
    • Customer Feedback
    • Needs Assessment

    Description

      Basic Info
      Module Version: 3.1.0
      Puppet Version: 6.x
      OS Name/Version: Windows

      When the ruby-pwsh library is missing or puppetserver is unable to load it, the module throws an error rather than saying the provider is not compatible. The provider does use a feature to handle this, however, there is an extra require that circumvents this behavior.

       

      PR 143 safe loads ruby-pwsh through a confine on the feature. The problem is that the powershell provider has a require_relative to powershell_hash_formatter which has a require 'ruby-pwsh', which is failing. That is why it is not safely failing, but I am not sure why it is failing to load the library since it is present on the system though. It is even odder that it only happens on the first agent runs after starting the service.

      https://github.com/puppetlabs/puppetlabs-dsc_lite/blob/main/lib/puppet/provider/base_dsc_lite/powershell.rb#L5
      https://github.com/puppetlabs/puppetlabs-dsc_lite/blob/main/lib/puppet_x/puppetlabs/dsc_lite/powershell_hash_formatter.rb#L3

       __ 

      Desired Behavior:

      The module should try to load the ruby-pwsh library safely

      Debug: Puppet::Provider::Base_dsc_list::Powershell: feature ruby-pwsh is missing 

      Actual Behavior:

      The module loads the library in a way that throws an error. 

       

      Puppet Could not autoload puppet/provider/base_dsc_lite/powershell: no such file to load -- ruby-pwsh org/jruby/RubyKernel.java:974:in `require' 

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jarret.lavallee Jarret Lavallee
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Zendesk Support