bolt icon indicating copy to clipboard operation
bolt copied to clipboard

Human outputter cannot print Hiera lookups when value is a Hash

Open donoghuc opened this issue 3 years ago • 0 comments

Describe the Bug

When printing a bolt lookup result the human outputter will stack trace trying to print the result when the hiera value is a Hash.

Finished on dbtgraf3nix1.se.automationdemos.com:
Traceback (most recent call last):
        15: from /opt/puppetlabs/bolt/bin/bolt:23:in `<main>'
        14: from /opt/puppetlabs/bolt/bin/bolt:23:in `load'
        13: from /opt/puppetlabs/bolt/lib/ruby/gems/2.7.0/gems/bolt-3.24.0/exe/bolt:11:in `<top (required)>'
        12: from /opt/puppetlabs/bolt/lib/ruby/gems/2.7.0/gems/bolt-3.24.0/lib/bolt/cli.rb:394:in `execute'
        11: from /opt/puppetlabs/bolt/lib/ruby/gems/2.7.0/gems/bolt-3.24.0/lib/bolt/cli.rb:944:in `with_signal_handling'
        10: from /opt/puppetlabs/bolt/lib/ruby/gems/2.7.0/gems/bolt-3.24.0/lib/bolt/cli.rb:395:in `block in execute'
         9: from /opt/puppetlabs/bolt/lib/ruby/gems/2.7.0/gems/bolt-3.24.0/lib/bolt/cli.rb:927:in `with_error_handling'
         8: from /opt/puppetlabs/bolt/lib/ruby/gems/2.7.0/gems/bolt-3.24.0/lib/bolt/cli.rb:521:in `block (2 levels) in execute'
         7: from /opt/puppetlabs/bolt/lib/ruby/gems/2.7.0/gems/bolt-3.24.0/lib/bolt/cli.rb:605:in `process_command'
         6: from /opt/puppetlabs/bolt/lib/ruby/gems/2.7.0/gems/bolt-3.24.0/lib/bolt/outputter/human.rb:868:in `print_result_set'
         5: from /opt/puppetlabs/bolt/lib/ruby/gems/2.7.0/gems/bolt-3.24.0/lib/bolt/result_set.rb:42:in `each'
         4: from /opt/puppetlabs/bolt/lib/ruby/gems/2.7.0/gems/bolt-3.24.0/lib/bolt/result_set.rb:42:in `each'
         3: from /opt/puppetlabs/bolt/lib/ruby/gems/2.7.0/gems/bolt-3.24.0/lib/bolt/result_set.rb:42:in `block in each'
         2: from /opt/puppetlabs/bolt/lib/ruby/gems/2.7.0/gems/bolt-3.24.0/lib/bolt/outputter/human.rb:868:in `block in print_result_set'
         1: from /opt/puppetlabs/bolt/lib/ruby/gems/2.7.0/gems/bolt-3.24.0/lib/bolt/outputter/human.rb:197:in `print_result'
/opt/puppetlabs/bolt/lib/ruby/gems/2.7.0/gems/bolt-3.24.0/lib/bolt/outputter.rb:28:in `indent': undefined method `gsub' for #<Hash:0x00007ff40c83adf8> (NoMethodError)

Expected Behavior

The human outputter can print hiera lookups for any value

Steps to Reproduce

lookup a hiera value that is a hash with bolt lookup

donoghuc avatar Aug 10 '22 17:08 donoghuc