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 1265686 - hammer content-view remove-version confusing with versions subcommand
Summary: hammer content-view remove-version confusing with versions subcommand
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hammer
Version: 6.1.2
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: Unspecified
Assignee: Andrew Kofink
QA Contact: jcallaha
URL:
Whiteboard:
Depends On:
Blocks: 1122832
TreeView+ depends on / blocked
 
Reported: 2015-09-23 13:24 UTC by Peter Vreman
Modified: 2019-09-25 21:16 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-07-27 11:27:35 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 14444 0 Normal Closed The hammer content view commands could use better descriptions 2020-12-11 04:42:42 UTC
Red Hat Bugzilla 1265665 0 unspecified CLOSED Hammer content-view remove-version not working, always duplicate numbers 2021-02-22 00:41:40 UTC

Internal Links: 1265665

Description Peter Vreman 2015-09-23 13:24:26 UTC
Description of problem:
The subcommands 'add-version' and 'remove-version' are confusing with the 'versions' subcommand.
Secondly the documentation of the commands is useless with a generic remark that the content view is updated and not what it actually updates

# hammer -c /opt/hoici/etc/sat6/hammer-hoici.yaml content-view --help
Usage:
    hammer content-view [OPTIONS] SUBCOMMAND [ARG] ...

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

Subcommands:
 add-repository                Associate a resource
 add-version                   Update a content view
 create                        Create a content view
 delete                        Delete a content view
 filter                        View and manage filters
 info                          Show a content view
 list                          List content views
 publish                       Publish a content view
 puppet-module                 View and manage puppet modules
 remove                        Remove versions and/or environments from a content view and reassign systems and keys
 remove-from-environment       Remove a content view from an environment
 remove-repository             Disassociate a resource
 remove-version                Update a content view
 update                        Update a content view
 version                       View and manage content view versions

Options:
 -h, --help                    print help

In fact the 'add-version' and 'remove-version' is related to the API variable called components and the webUI 'content view'

This can also be seen with the output of remove-version:
# hammer -c /opt/hoici/etc/sat6/hammer-hoici.yaml content-view remove-version  --organization-id=3 --id=13 --content-view-version-id=90
The component version has been removed





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


How reproducible:


Steps to Reproduce:
1. See in general description.
2.
3.

Actual results:


Expected results:
Please rename the variables to what they really do, as 'version' is too generic name.
Proposals is to stay consistent with the API and change it to 
- add-content-view-version-id
- remove-content-view-version-id

And for the description e.g. 'Associate a content view version (for composite content views only)'


Additional info:
The add-content-view-version-id is still a poor user-experience. It would be better to have a subcommand with additional option
- add-content-view
     --add-id | --add-name
     --add-environment
     --add-version
     --add-version-id

Comment 2 Andrew Kofink 2016-04-13 15:04:02 UTC
I feel like the version subcommand should allow adding/removing versions, as is consistent with the rest of the hammer interface. The add-version and remove-version subcommands on content-view should really be replaced with `content-view version create` and `content-view version delete`.

Secondly, I think we should make an effort to have valid descriptions for all hammer [sub]commands, but I think this should be a distinct bug, which I can create.

Any feedback is appreciated.

Comment 3 Andrew Kofink 2016-04-13 15:56:36 UTC
Created redmine issue http://projects.theforeman.org/issues/14620 from this bug

Comment 4 Andrew Kofink 2016-04-15 12:42:11 UTC
This is fixed with https://github.com/Katello/hammer-cli-katello/pull/377

Duplicate of http://projects.theforeman.org/issues/14444

Comment 5 jcallaha 2016-06-09 20:13:25 UTC
Verified in Satellite 6.2 beta Snap 15.

You can delete versions with the 'version' sub-command.

[root@apollo pulp]# 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
 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

Comment 6 Bryan Kearney 2016-07-27 11:27:35 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, 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-2016:1501


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