Bug 1416862

Summary: `hammer content-view remove` has unnecessary option `--content-view-version-content-view-ids`
Product: Red Hat Satellite Reporter: Andrew Kofink <akofink>
Component: Content ViewsAssignee: Andrew Kofink <akofink>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 6.3.0CC: bbuckingham, bkearney, jcallaha, oshtaier
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-21 16:49:54 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 Andrew Kofink 2017-01-26 15:59:42 UTC
Description of problem:
The option `--content-view-version-content-view-ids` is not needed and can be specified with `--id` or `--name`.

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

How reproducible:
Always

Steps to Reproduce:
1. `hammer content-view remove -h`
2. `hammer content-view remove --content-view-versions '1.2,3.0,4.6' --id 1`
3.

Actual results:
(1.) The option `--content-view-version-content-view-ids` is listed, and (2.) the following error is shown:

Could not remove objects from content view:
  Error: Could not find content_view_version, please set one of options --content-view-versions, --content-view-version-content-view-ids.

Expected results:
(1.) The option `--content-view-version-content-view-ids` is not listed, and (2.) the content view versions are removed from the content view.

Additional info:

Comment 3 Andrew Kofink 2017-02-01 18:53:06 UTC
Created redmine issue http://projects.theforeman.org/issues/18352 from this bug

Comment 4 Oleksandr Shtaier 2017-07-20 08:24:10 UTC
Verified on latest 6.3

Necessary option were removed for 'remove' command:

hammer content-view remove --help
Usage:
    hammer content-view remove [OPTIONS]

Options:
 --async                                               Do not wait for the task
 --content-view-version-ids VERSION_IDS                Comma separated list of version ids to remove
 --content-view-versions CONTENT_VIEW_VERSION_VERSIONS Comma separated list of values. Values containing comma should be double quoted
 --environment-ids ENVIRONMENT_IDS                     Comma separated list of environment ids to remove
 --environments ENVIRONMENT_NAMES                      Comma separated list of values. Values containing comma should be double quoted
 --id ID                                               content view numeric identifier
 --key-content-view-id KEY_CONTENT_VIEW_ID             content view to reassign orphaned activation keys to
 --key-environment-id KEY_ENVIRONMENT_ID               environment to reassign orphaned activation keys to
 --name NAME                                           Content view name to search by
 --organization ORGANIZATION_NAME                      Organization name to search by
 --organization-id ORGANIZATION_ID                     Organization ID to search by
 --organization-label ORGANIZATION_LABEL               Organization label to search by
 --system-content-view-id SYSTEM_CONTENT_VIEW_ID       content view to reassign orphaned systems to
 --system-environment-id SYSTEM_ENVIRONMENT_ID         environment to reassign orphaned systems to


And corresponding hammer functionality works as intended:
hammer -v -u admin -p changeme  content-view remove --id="76" --content-view-versions="1.0"
Task c5a5d349-6b0d-4ae6-8d60-a503fa43312f running: 0.0/1, 0%, elapsed: 00:00:00
Task c5a5d349-6b0d-4ae6-8d60-a503fa43312f success: 1.0/1, 100%, 0.5/s, elapsed: 00:00:02
Task c5a5d349-6b0d-4ae6-8d60-a503fa43312f success: 1.0/1, 100%, 0.5/s, elapsed: 00:00:02

Comment 5 Satellite Program 2018-02-21 16:49:54 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/RHSA-2018:0336