Bug 1102485

Summary: capsule: Unhandled error when passing bad id to 'hammer capsule content'
Product: Red Hat Satellite Reporter: Corey Welton <cwelton>
Component: Foreman ProxyAssignee: Ivan Necas <inecas>
Status: CLOSED WORKSFORME QA Contact: Katello QA List <katello-qa-list>
Severity: low Docs Contact:
Priority: unspecified    
Version: 6.0.3CC: andrew.schofield, bbuckingham, bkearney, kabbott, pmoravec
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-10-04 12:42:15 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Corey Welton 2014-05-29 04:30:22 UTC
Description of problem:

When accidentally passing the fqdn of a capsule rather than id (or presumably any bad string, really), we get an unhandled trace.

Version-Release number of selected component (if applicable):

Satellite-6.0.3-RHEL-6-20140528.4
How reproducible:


Steps to Reproduce:
1.  Try to submit a sync command to capsule, using an invalid string for --id (i.e., maybe the capsule fqdn)
2.  View results.


Actual results:
root@ibm-x3550m3-07 ~]# hammer capsule content synchronize
Could not synchronize capsule content:
  missing param 'id' in parameters
[root@ibm-x3550m3-07 ~]# hammer capsule content synchronize --id cloud-qe-9.idm.lab.bos.redhat.com
/usr/lib/ruby/gems/1.8/gems/fast_gettext-0.8.0/lib/fast_gettext/vendor/string.rb:56:in `_fast_gettext_old_format_m': malformed format string - %; (ArgumentError)
        from /usr/lib/ruby/gems/1.8/gems/fast_gettext-0.8.0/lib/fast_gettext/vendor/string.rb:56:in `%'
        from /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/utils.rb:12:in `format'
        from /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/output/adapter/abstract.rb:27:in `print_error'
        from /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/output/output.rb:16:in `print_error'
        from /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/exception_handler.rb:43:in `print_error'
        from /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/exception_handler.rb:60:in `handle_general_exception'
        from /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/exception_handler.rb:26:in `send'
        from /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/exception_handler.rb:26:in `handle_exception'
        from /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/../abstract.rb:188:in `handle_exception'
        from /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/../abstract.rb:26:in `run'
        from /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:125:in `run'
        from /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/bin/hammer:100
        from /usr/bin/hammer:19:in `load'
        from /usr/bin/hammer:19


Expected results:
Clean handling of the invalid input.  Perhaps something as easy as

Unknown 'id': <string>

Additional info:

Comment 2 Pavel Moravec 2014-11-14 12:06:11 UTC
Little bit related: bz1164233

Comment 4 Bryan Kearney 2016-10-04 12:42:15 UTC
I could not recreate this on satellite 6.3. I am closing this out as NEXTRELEASE.