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

chocolatey : warning: already initialized constant

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • None
    • None
    • None
    • None
    • Windows
    • 1
    • Windows 2019-01-16
    • Needs Assessment
    • Needs Assessment

    Description

      Basic Info
      Module Version: 3.0.0
      Puppet Version: 4.10.10
      OS Name/Version: Redhat 6.9

      When using puppet device with multiple devices in one device config file, puppet is printing warnings to stderr about already initialized constant.

      This can be fixed by using "unless defined".

      Desired Behavior:

      Not initialising contants multiple times. 

      Actual Behavior:

      $ puppet device --deviceconfig /etc/puppetlabs/puppet/device/device.conf

      /opt/puppetlabs/puppet/cache/devices/device-x/lib/puppet_x/chocolatey/chocolatey_version.rb:8: warning: already initialized constant PuppetX::Chocolatey::ChocolateyVersion::OLD_CHOCO_MESSAGE
      /opt/puppetlabs/puppet/cache/devices/device-y/lib/puppet_x/chocolatey/chocolatey_version.rb:8: warning: previous definition of OLD_CHOCO_MESSAGE was here
      /opt/puppetlabs/puppet/cache/devices/device-x/lib/puppet_x/chocolatey/chocolatey_common.rb:10: warning: already initialized constant PuppetX::Chocolatey::ChocolateyCommon::FIRST_COMPILED_CHOCO_VERSION
      /opt/puppetlabs/puppet/cache/devices/device-y/lib/puppet_x/chocolatey/chocolatey_common.rb:10: warning: previous definition of FIRST_COMPILED_CHOCO_VERSION was here
      /opt/puppetlabs/puppet/cache/devices/device-x/lib/puppet_x/chocolatey/chocolatey_common.rb:11: warning: already initialized constant PuppetX::Chocolatey::ChocolateyCommon::MINIMUM_SUPPORTED_CHOCO_VERSION_EXIT_CODES
      /opt/puppetlabs/puppet/cache/devices/device-y/lib/puppet_x/chocolatey/chocolatey_common.rb:11: warning: previous definition of MINIMUM_SUPPORTED_CHOCO_VERSION_EXIT_CODES was here
      /opt/puppetlabs/puppet/cache/devices/device-x/lib/puppet_x/chocolatey/chocolatey_common.rb:12: warning: already initialized constant PuppetX::Chocolatey::ChocolateyCommon::MINIMUM_SUPPORTED_CHOCO_UNINSTALL_SOURCE
      /opt/puppetlabs/puppet/cache/devices/device-y/lib/puppet_x/chocolatey/chocolatey_common.rb:12: warning: previous definition of MINIMUM_SUPPORTED_CHOCO_UNINSTALL_SOURCE was here

      Attachments

        Activity

          People

            michael.lombardi Michael Lombardi
            btoonk Bas Toonk
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Zendesk Support