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

glob/globs in hiera 5 does not work (no implicit conversion of String into Integer)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: PUP 4.9.2
    • Fix Version/s: PUP 4.9.3
    • Component/s: None
    • Labels:
    • Environment:
    • Template:
    • Team:
      Puppet Developer Experience
    • Story Points:
      1
    • Sprint:
      PDE 2017-02-22, PDE 2017-03-08
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      The new hiera 5 feature supporting path globs in hiera.yaml did not work as expected.
    • QA Risk Assessment:
      No Action
    • QA Risk Assessment Reason:
      covered by unit tests

      Description

      Hi,

      i'm currently migrate from hiera 3 to hiera 5. I want to use new features like glob/globs. hiere is my test hiera config:

      ---
      version: 5
       
      defaults:
        datadir: "/etc/puppetlabs/code/environments/"
        data_hash: yaml_data
       
      hierarchy:
        - name: "Puppet Common"
          globs:
            - "%{environment}/hiera/common/*.yaml"
       
        - name: "Puppet Common"
          paths:
            - "%{environment}/hiera/common.yaml"
      

      Any lookup related calls will result into an error:

      puppet lookup --hiera_config /etc/puppetlabs/puppet/hiera.yaml.glob profile::yumrepo::groups --environment fix_puppet --merge unique  --trace
      Error: Could not run: no implicit conversion of String into Integer
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup/location_resolver.rb:39:in `glob'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup/location_resolver.rb:39:in `glob'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup/location_resolver.rb:39:in `block in expand_globs'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup/location_resolver.rb:37:in `map'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup/location_resolver.rb:37:in `expand_globs'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup/hiera_config.rb:518:in `block in create_configured_data_providers'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup/hiera_config.rb:499:in `each'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup/hiera_config.rb:499:in `create_configured_data_providers'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup/hiera_config.rb:163:in `configured_data_providers'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup/configured_data_provider.rb:83:in `data_providers'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup/configured_data_provider.rb:44:in `block in unchecked_key_lookup'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup/invocation.rb:112:in `with'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup/configured_data_provider.rb:42:in `unchecked_key_lookup'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup/global_data_provider.rb:26:in `unchecked_key_lookup'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup/data_provider.rb:45:in `block in key_lookup'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup/invocation.rb:73:in `check'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup/data_provider.rb:45:in `key_lookup'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup/lookup_adapter.rb:72:in `lookup_global'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup/lookup_adapter.rb:227:in `block in do_lookup'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/merge_strategy.rb:129:in `block (3 levels) in lookup'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/merge_strategy.rb:128:in `catch'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/merge_strategy.rb:128:in `block (2 levels) in lookup'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/merge_strategy.rb:126:in `each'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/merge_strategy.rb:126:in `reduce'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/merge_strategy.rb:126:in `block in lookup'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup/invocation.rb:112:in `with'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/merge_strategy.rb:125:in `lookup'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup/lookup_adapter.rb:227:in `do_lookup'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup/lookup_adapter.rb:61:in `block (2 levels) in lookup'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup/invocation.rb:112:in `with'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup/lookup_adapter.rb:61:in `block in lookup'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup/invocation.rb:58:in `lookup'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup/lookup_adapter.rb:50:in `lookup'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup.rb:76:in `search_and_merge'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup.rb:31:in `block (2 levels) in lookup'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup.rb:31:in `catch'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup.rb:31:in `block in lookup'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup.rb:29:in `each'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup.rb:29:in `reduce'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/pops/lookup.rb:29:in `lookup'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/lookup.rb:298:in `block in main'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/lookup.rb:342:in `block in generate_scope'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/parser/compiler.rb:204:in `block in compile'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/context.rb:65:in `override'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:293:in `override'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/parser/compiler.rb:162:in `compile'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/lookup.rb:342:in `generate_scope'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/lookup.rb:294:in `main'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:352:in `run_command'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:344:in `block in run'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:541:in `exit_on_fail'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:344:in `run'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:132:in `run'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:72:in `execute'
      /opt/puppetlabs/puppet/bin/puppet:5:in `<main>'
      

      --compile does not matter here. If I remove the glob setting, the lookup will work again.

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            jkroepke Jan-Otto Kröpke
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Zendesk Support