Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1867742 - "capsule content" command not working in hammer shell
Summary: "capsule content" command not working in hammer shell
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hammer
Version: 6.8.0
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: 6.8.0
Assignee: Oleh Fedorenko
QA Contact: Tasos Papaioannou
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-08-10 16:09 UTC by Radovan Drazny
Modified: 2020-10-27 13:32 UTC (History)
8 users (show)

Fixed In Version: tfm-rubygem-hammer_cli-2.1.2
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-10-27 13:32:13 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 30747 0 Normal Closed "capsule content" command not working in hammer shell 2020-09-21 09:36:50 UTC
Github theforeman hammer-cli pull 335 0 None closed Fixes #30747 - Make fuzzy search work in hammer shell 2020-09-21 09:36:50 UTC
Red Hat Product Errata RHBA-2020:4367 0 None None None 2020-10-27 13:32:16 UTC

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


Note You need to log in before you can comment on or make changes to this bug.