Bug 1909768

Summary: hammer content-view version export-histories failing for '--help' flag
Product: Red Hat Satellite Reporter: Gaurav Talreja <gtalreja>
Component: Content ViewsAssignee: Chris Roberts <chrobert>
Status: CLOSED ERRATA QA Contact: Danny Synk <dsynk>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.9.0CC: ahumbe, chrobert, croberts, jsherril
Target Milestone: 6.9.0Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: tfm-rubygem-hammer_cli_katello-0.24.0.1-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-04-21 13:24:23 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 Gaurav Talreja 2020-12-21 15:05:21 UTC
Description of problem:

Version-Release number of selected component (if applicable):
@Satellite 6.9.0 snap 6.0
tfm-rubygem-hammer_cli_katello-0.24.0-1.el7sat.noarch
tfm-rubygem-hammer_cli-2.3.0-1.el7sat.noarch

How reproducible:
always

Steps to Reproduce:
1. # hammer content-view version export-histories --help
   Error: undefined method `[]' for nil:NilClass

2. # echo $?
   70
3. # hammer full-help
   .
   .
   .
   Error: undefined method `[]' for nil:NilClass


Actual results:
Error: undefined method `[]' for nil:NilClass

Expected results:
1. Output of command with --help flag
2. hammer full-help should work

Additional info:
Works in Satellite 6.9.0 snap 5.0

Comment 1 Brad Buckingham 2021-01-04 15:37:19 UTC
Removing Regression keyword as this is a new command in Satellite.  Also, this command will only apply with Pulp3.

Comment 2 Justin Sherrill 2021-02-05 00:56:56 UTC
Chris, 

it looks like this command was removed here:  https://github.com/Katello/hammer-cli-katello/commit/6ca1e65df2520e92b7f5294180214445591be5b6 

i wonder if for 6.9 we should just remove this command?

Comment 3 Chris Roberts 2021-02-12 15:43:20 UTC
Justin,

Yeah we can just remove it from 6.9.

I will open up a MR for it

Comment 5 Danny Synk 2021-02-22 16:05:34 UTC
Steps to test:

1. Deploy a Satellite 6.9, snap 14.

2. Enter hammer shell and verify that `export-histories` is not present in the list of subcommands of `hammer content-view version`:

~~~
# hammer shell
Welcome to the hammer interactive shell.
Type 'help' for usage information.
hammer> content-view version 
--help                   export                   import                   info                     republish-repositories   
-h                       export-default           incremental-update       list                     show                     
delete                   export-legacy            index                    promote                  update                   
~~~

3. Verify that `export-histories` is not present in the output of `hammer content-view version --help`:

~~~
# hammer content-view version --help
Usage:
    hammer content-view version [OPTIONS] SUBCOMMAND [ARG] ...

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

Subcommands:
 delete                        Remove content view version
 export                        Export a content view version
 export-default                Export the library default content view
 export-legacy                 Export a content view (legacy method)
 import                        Import a content view version
 incremental-update            Perform an Incremental Update on one or more Content View Versions
 info                          Show content view version
 list                          List content view versions
 promote                       Promote a content view version
 republish-repositories        Forces a republish of the version's repositories' metadata
 update                        Update a content view version

Options:
 -h, --help                    Print help
~~~

4. Attempt to run `hammer content-view version export-histories --help`:

~~~
# hammer content-view version export-histories --help
Error: No such sub-command 'export-histories'.

See: 'hammer content-view version --help'.
You have mail in /var/spool/mail/root
~~~

Expected Results:
`export-histories` is no longer present in help text or hammer shell options of `hammer content-view version`. Running `hammer content-view version export-histories` produces an error indicating that this is not a valid subcommand.

Actual Results:
`export-histories` is no longer present in help text or hammer shell options of `hammer content-view version`. Running `hammer content-view version export-histories` produces an error indicating that this is not a valid subcommand.

Verified on Satellite 6.9, snap 14 (tfm-rubygem-hammer_cli_katello-0.24.0.1-1.el7sat.noarch).

Comment 8 errata-xmlrpc 2021-04-21 13:24:23 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 (Moderate: Satellite 6.9 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/RHSA-2021:1313