Bug 1867742

Summary: "capsule content" command not working in hammer shell
Product: Red Hat Satellite Reporter: Radovan Drazny <rdrazny>
Component: HammerAssignee: Oleh Fedorenko <ofedoren>
Status: CLOSED ERRATA QA Contact: Tasos Papaioannou <tpapaioa>
Severity: low Docs Contact:
Priority: unspecified    
Version: 6.8.0CC: apatel, chrobert, kgaikwad, ltran, mshira, ofedoren, pcreech, rabajaj
Target Milestone: 6.8.0Keywords: Regression, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: tfm-rubygem-hammer_cli-2.1.2 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-10-27 13:32:13 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 Radovan Drazny 2020-08-10 16:09:12 UTC
Description of problem:
Running "hammer capsule content" doesn't work properly. 


Version-Release number of selected component (if applicable):
Satellite 6.8 Snap 10
tfm-rubygem-hammer_cli-2.1.1-1.el7sat.noarch

How reproducible:
always

Steps to Reproduce:
1. Start "hammer shell"
2. Run "capsule content"

Actual results:
Running "capsule --help" gives following output:

hammer> capsule --help
Usage:
    capsule [OPTIONS] SUBCOMMAND [ARG] ...

Parameters:
 SUBCOMMAND                    Subcommand
 [ARG] ...                     Subcommand arguments

Subcommands:
 content                       Manage the capsule content
 create                        Create a capsule
 delete                        Delete a capsule
 import-classes                Import puppet classes from puppet Capsule
 info                          Show a capsule
 list                          List all capsules
 refresh-features              Refresh capsule features
 update                        Update a capsule

Options:
 -h, --help 


If you try "capsule content" or "capsule content --help" you will get following:

hammer> capsule content
Error: Found more than one command.

Did you mean one of these?
        content-credentials
        content-view


The "capsule content" command cannot be run from hammer shell. Replacing "capsule" with "proxy" causes the same error.

Expected results:
The "capsule content" command can be run from hammer shell

Additional info:
The workaround is simple - run the command directly from the command shell like bash. Running "hammer capsule content --help" returns correct data.

$ hammer capsule content --help
Usage:
    hammer capsule content [OPTIONS] SUBCOMMAND [ARG] ...

Parameters:
 SUBCOMMAND                    Subcommand
 [ARG] ...                     Subcommand arguments

Subcommands:
 add-lifecycle-environment        Add lifecycle environments to the capsule
 available-lifecycle-environments List the lifecycle environments not attached to the capsule
 cancel-synchronization           Cancel running capsule synchronization
 info                             Get current capsule synchronization status
 lifecycle-environments           List the lifecycle environments attached to the capsule
 remove-lifecycle-environment     Remove lifecycle environments from the capsule
 synchronization-status           Get current capsule synchronization status
 synchronize                      Synchronize the content to the capsule

Options:
 -h, --help                    Print help

Comment 1 Oleh Fedorenko 2020-08-31 15:43:54 UTC
Switching back to Hammer component since this is a bug in hammer core.

Comment 2 Oleh Fedorenko 2020-08-31 15:45:00 UTC
Created redmine issue https://projects.theforeman.org/issues/30747 from this bug

Comment 3 Bryan Kearney 2020-08-31 16:04:38 UTC
Upstream bug assigned to ofedoren

Comment 4 Bryan Kearney 2020-08-31 16:04:40 UTC
Upstream bug assigned to ofedoren

Comment 5 Tasos Papaioannou 2020-09-15 13:43:19 UTC
Verified on 6.8.0 snap 15.0:

----

# rpm -q tfm-rubygem-hammer_cli-2.1.2
tfm-rubygem-hammer_cli-2.1.2-1.el7sat.noarch

# hammer shell
Welcome to the hammer interactive shell.
Type 'help' for usage information.
hammer> capsule
Usage:
    capsule [OPTIONS] SUBCOMMAND [ARG] ...

Parameters:
 SUBCOMMAND                    Subcommand
 [ARG] ...                     Subcommand arguments

Subcommands:
 content                       Manage the capsule content
 create                        Create a capsule
 delete                        Delete a capsule
 import-classes                Import puppet classes from puppet Capsule
 info                          Show a capsule
 list                          List all capsules
 refresh-features              Refresh capsule features
 update                        Update a capsule

Options:
 -h, --help                    Print help


hammer> capsule content
Usage:
    capsule [OPTIONS] SUBCOMMAND [ARG] ...

Parameters:
 SUBCOMMAND                    Subcommand
 [ARG] ...                     Subcommand arguments

Subcommands:
 add-lifecycle-environment        Add lifecycle environments to the capsule
 available-lifecycle-environments List the lifecycle environments not attached to the capsule
 cancel-synchronization           Cancel running capsule synchronization
 info                             Get current capsule synchronization status
 lifecycle-environments           List the lifecycle environments attached to the capsule
 remove-lifecycle-environment     Remove lifecycle environments from the capsule
 synchronization-status           Get current capsule synchronization status
 synchronize                      Synchronize the content to the capsule

Options:
 -h, --help                    Print help


hammer> capsule content --help
Usage:
    capsule [OPTIONS] SUBCOMMAND [ARG] ...

Parameters:
 SUBCOMMAND                    Subcommand
 [ARG] ...                     Subcommand arguments

Subcommands:
 add-lifecycle-environment        Add lifecycle environments to the capsule
 available-lifecycle-environments List the lifecycle environments not attached to the capsule
 cancel-synchronization           Cancel running capsule synchronization
 info                             Get current capsule synchronization status
 lifecycle-environments           List the lifecycle environments attached to the capsule
 remove-lifecycle-environment     Remove lifecycle environments from the capsule
 synchronization-status           Get current capsule synchronization status
 synchronize                      Synchronize the content to the capsule

Options:
 -h, --help                    Print help


hammer> content
Error: Found more than one command.

Did you mean one of these?
	content-credentials
	content-view
hammer> 

----

Comment 8 errata-xmlrpc 2020-10-27 13:32:13 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Satellite 6.8 Satellite Tools Release), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:4367