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

puppetlabs-chocolatey does not propagate null source error correctly

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: chocolatey
    • Environment:

      VMware Windows 2012 r2 .NET4.5
      puppet agent v3.8.7
      Chocolatey v0.10.3
      puppetlabs-chocolatey v2.0.0-b20066-35b34ff1

    • Template:
    • Acceptance Criteria:
      Hide

      Choco expected error gets propagated up to the user and reads "Installation was NOT successful. There are no sources enabled for packages and none were passed as arguments."

      Install Chocolatey, remove all sources

      • choco source remove -n chocolatey

      Then run a simple manifest like

      package {'7zip':
        ensure   => present,
        provider => chocolatey,
      }
      

      You should get a Puppet failure if no sources are enabled. Unfortunately it doesn't matter if you provide a source or not. See the link to the Chocolatey issue below.

      Show
      Choco expected error gets propagated up to the user and reads "Installation was NOT successful. There are no sources enabled for packages and none were passed as arguments." Install Chocolatey, remove all sources choco source remove -n chocolatey Then run a simple manifest like package {'7zip': ensure => present, provider => chocolatey, } You should get a Puppet failure if no sources are enabled. Unfortunately it doesn't matter if you provide a source or not. See the link to the Chocolatey issue below.
    • Team:
      Modules
    • Story Points:
      2
    • Sprint:
      Modules 2016-12-14

      Description

      Repro steps:

      1. Install puppet agent.
      2. Install chocolatey client
      3. Install chocolatey module
      4. Remove all <source> from the Chocolatey config file \ProgramData\chocolatey\config\chocolatey.config
      5. Apply a manifest that installs a package like this:
        package { "7zip": ensure => present, provider => chocolatey, }

      Expected error (this is what you get if you run the choco command directly on the command line):
      Installation was NOT successful. There are no sources enabled for packages and none were passed as arguments.

      Actual error:
      Notice: Compiled catalog for win-lqdv0cfio2q.localdomain in environment production in 0.02 seconds
      Error: Could not prefetch package provider 'chocolatey': undefined method `each' for nil:NilClass
      Error: /Package[7zip]: Could not evaluate: undefined method `each' for nil:NilClass

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              rob Rob Reynolds
              Reporter:
              erick Erick Banks
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support