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

puppet_pot_generator: semantic_puppet dependency no longer necessary

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Template:
      MODULES Bug Template
    • Method Found:
      Needs Assessment
    • QA Risk Assessment:
      Needs Assessment

      Description

      puppet_pot_generator depends on 'puppet' with no version bounds. In the lastest versions of Puppet ( > 4.9.0) semantic_puppet is vendored inside. Further, the latest version of Puppet conflicts with the semantic_puppet gem, so it needs to go away.

      This dependency was causing failures in all module unit tests that looked something like this:

      127) Puppet::Type::Dsc_package should not accept array for dsc_installed
             Failure/Error: expect{dsc_package[:dsc_installed] = ["foo", "bar", "spec"]}.to raise_error(Puppet::ResourceError)
             
               expected Puppet::ResourceError, got #<FastGettext::Storage::NoTextDomainConfigured: Current textdomain ("master_domain") was not added, use FastGettext.add_text_domain !> with backtrace:
                 # ./vendor/bundle/ruby/2.4.0/gems/fast_gettext-1.1.2/lib/fast_gettext/storage.rb:79:in `current_repository'
                 # ./vendor/bundle/ruby/2.4.0/gems/fast_gettext-1.1.2/lib/fast_gettext/storage.rb:87:in `block in cached_find'
                 # ./vendor/bundle/ruby/2.4.0/gems/fast_gettext-1.1.2/lib/fast_gettext/cache.rb:11:in `fetch'
                 # ./vendor/bundle/ruby/2.4.0/gems/fast_gettext-1.1.2/lib/fast_gettext/storage.rb:87:in `cached_find'
                 # ./vendor/bundle/ruby/2.4.0/gems/fast_gettext-1.1.2/lib/fast_gettext/translation.rb:21:in `_'
                 # ./vendor/bundle/ruby/2.4.0/gems/puppet-5.3.4/lib/puppet/parameter.rb:428:in `rescue in munge'
                 # ./vendor/bundle/ruby/2.4.0/gems/puppet-5.3.4/lib/puppet/parameter.rb:422:in `munge'
                 # ./vendor/bundle/ruby/2.4.0/gems/puppet-5.3.4/lib/puppet/parameter.rb:493:in `value='
                 # ./vendor/bundle/ruby/2.4.0/gems/puppet-5.3.4/lib/puppet/type.rb:674:in `[]='
                 # ./spec/unit/puppet/type/dsc_package_spec.rb:352:in `block (3 levels) in <top (required)>'
                 # ./spec/unit/puppet/type/dsc_package_spec.rb:352:in `block (2 levels) in <top (required)>'
             # ./spec/unit/puppet/type/dsc_package_spec.rb:352:in `block (2 levels) in <top (required)>'
      

      Here's roughly what was happening:

      1. Tests start
      2. Puppet is required
      3. Puppet (5.3.4) now handles its own FastGettext implementation, so it creates a translation_repository chain and sets FastGettext.default_text_domain to 'default-text-domain'
      4. semantic_puppet is required by puppet_pot_generator
      5. semantic_puppet initializes Ye Olde GettextSetup, which adds 'master_domain' to the chain and sets FastGettext.text_domain to the same
      6. At some magical point, Puppet is like "ok, resetting the environment" and kills all text_domains that are not the default
      7. Somehow, FastGettext.text_domain is still 'master_domain' but it's no longer in the chain, and that's how you get the error above

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              eric.putnam Eric Putnam
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support