Project

General

Profile

Bug #4013

Using --output for Info command fails with a stacktrace

Added by Og Maciel over 6 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Normal
Category:
-
Target version:
Difficulty:
Triaged:
Bugzilla link:
Pull request:
Team Backlog:
Fixed in Releases:
Found in Releases:
In Kanboard:

Description

Using the csv output flag for the Info command is failing. The same happens with table output:

2014-01-14 09:54:05 - robottelo - DEBUG - LANG=en_US hammer -u admin -p changeme architecture create --name='MMdQUePIwN'
2014-01-14 09:54:05 - robottelo - DEBUG - Architecture created
2014-01-14 09:54:11 - robottelo - DEBUG - LANG=en_US hammer -u admin -p changeme --output csv architecture list --search='name="MMdQUePIwN"'
2014-01-14 09:54:11 - robottelo - DEBUG - Id,Name
541,MMdQUePIwN
2014-01-14 09:54:12 - robottelo - DEBUG - LANG=en_US hammer -u admin -p changeme --output csv architecture info --name='MMdQUePIwN'
2014-01-14 09:54:12 - robottelo - DEBUG - Error: undefined method `join' for "":String

Stacktrace:

[ERROR 2014-01-14 15:00:49 Exception] Error: undefined method `join' for "":String
Error: undefined method `join' for "":String
[ERROR 2014-01-14 15:00:49 Exception]

NoMethodError (undefined method `join' for "":String):
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.14/lib/hammer_cli/output/formatters.rb:102:in `format'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.14/lib/hammer_cli/output/formatters.rb:62:in `format'
    /usr/lib/ruby/gems/1.8/gems/logging-1.8.1/lib/logging/logger.rb:435:in `inject'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.14/lib/hammer_cli/output/formatters.rb:62:in `each'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.14/lib/hammer_cli/output/formatters.rb:62:in `inject'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.14/lib/hammer_cli/output/formatters.rb:62:in `format'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.14/lib/hammer_cli/output/adapter/csv.rb:33:in `print_collection'
    /usr/lib/ruby/gems/1.8/gems/logging-1.8.1/lib/logging/logger.rb:435:in `inject'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.14/lib/hammer_cli/output/adapter/csv.rb:29:in `each'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.14/lib/hammer_cli/output/adapter/csv.rb:29:in `inject'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.14/lib/hammer_cli/output/adapter/csv.rb:29:in `print_collection'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.14/lib/hammer_cli/output/adapter/csv.rb:28:in `each'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.14/lib/hammer_cli/output/adapter/csv.rb:28:in `print_collection'
    /usr/lib/ruby/gems/1.8/gems/fastercsv-1.5.4/lib/faster_csv.rb:1077:in `generate'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.14/lib/hammer_cli/output/adapter/csv.rb:73:in `generate'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.14/lib/hammer_cli/output/adapter/csv.rb:24:in `print_collection'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.14/lib/hammer_cli/output/adapter/csv.rb:20:in `print_record'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.14/lib/hammer_cli/output/output.rb:20:in `print_record'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.14/lib/hammer_cli/abstract.rb:150:in `print_record'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.0.15/lib/hammer_cli_foreman/commands.rb:133:in `print_data'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.14/lib/hammer_cli/./apipie/read_command.rb:10:in `execute'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.14/lib/hammer_cli/abstract.rb:22:in `run'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:11:in `execute'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.14/lib/hammer_cli/abstract.rb:22:in `run'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:11:in `execute'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.14/lib/hammer_cli/abstract.rb:22:in `run'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:125:in `run'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.14/bin/hammer:61
    /usr/bin/hammer:19:in `load'
    /usr/bin/hammer:19

Environment:

  • foreman-1.4.0-0.develop.201401071212git9ef39dd.el6.noarch
  • foreman-ovirt-1.4.0-0.develop.201401071212git9ef39dd.el6.noarch
  • foreman-compute-1.4.0-0.develop.201401071212git9ef39dd.el6.noarch
  • foreman-libvirt-1.4.0-0.develop.201401071212git9ef39dd.el6.noarch
  • rubygem-hammer_cli_foreman-0.0.15-1.el6.noarch
  • foreman-release-1.4.0-0.develop.201401071212git9ef39dd.el6.noarch
  • foreman-proxy-1.4.0-0.develop.201401031522gitd3509e6.el6.noarch
  • foreman-selinux-1.4.0-0.develop.201311220906gite342a0b.el6.noarch
  • foreman-installer-1.4.0-0.develop.201401031335gitf3eee21.el6.noarch
  • rubygem-foreman_api-0.1.9-1.el6.noarch
  • foreman-postgresql-1.4.0-0.develop.201401071212git9ef39dd.el6.noarch

Associated revisions

Revision bc3efdb3 (diff)
Added by Tomas Strachota over 6 years ago

fixes #4013 - list formatter exception

Revision 5cfe4b63
Added by Tomas Strachota over 6 years ago

Merge pull request #71 from tstrachota/4013_list_formatter

fixes #4013 - list formatter exception

History

#1 Updated by Tomáš Strachota over 6 years ago

  • Status changed from New to Assigned
  • Assignee set to Tomáš Strachota
  • Target version set to 1.9.2

#2 Updated by Tomáš Strachota over 6 years ago

  • Status changed from Assigned to Ready For Testing

#3 Updated by Og Maciel over 6 years ago

Proposed patch worked like a charm!

#4 Updated by Anonymous over 6 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

Applied in changeset foreman:hammer-cli|commit:bc3efdb3dc30693ca4af0b9ca3d8e86d9421c52c.

Also available in: Atom PDF