This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 1470565 - Not able to delete content-view version using hammer command [NEEDINFO]
Not able to delete content-view version using hammer command
Status: NEW
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Content Views (Show other bugs)
All All
high Severity high (vote)
: Unspecified
: --
Assigned To: satellite6-bugs
Depends On:
  Show dependency treegraph
Reported: 2017-07-13 04:36 EDT by Preetesh Sharma
Modified: 2017-10-06 11:01 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
bbuckingham: needinfo? (prsharma)

Attachments (Terms of Use)

  None (edit)
Description Preetesh Sharma 2017-07-13 04:36:44 EDT
Description of problem: Not able to delete content-view version using hammer command.

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

How reproducible:

[root@redhat ~]# hammer shell
Welcome to the hammer interactive shell
Type 'help' for usage information
hammer> content-view version list
[Foreman] Password for admin: 
ID | NAME                          | VERSION | LIFECYCLE ENVIRONMENTS
3  | test 2.0                      | 2.0     | Library               
2  | test 1.0                      | 1.0     |                       
1  | Default Organization View 1.0 | 1.0     | Library               

hammer> content-view remove-version --id 2.0 --content-view-version-id 1
The component version has been removed
hammer> exit

This will show that component has removed but its not. To remove content-view version we need to execute below command.

# hammer content-view remove --content-view-version-ids <content-view-version-id> --id <content-view-id>

[root@redhat ~]# hammer shell

hammer> content-view remove --content-view-version-ids 2 --id 2
[........................................................................................................................................] [100%]

Actual results: Command executes successfully but still content-view version is present in satellite.

Expected results: content-view version must be deleted completely.
Comment 1 Marek Hulan 2017-07-19 04:32:52 EDT
This seems like content view specific command. The "--id 2.0" in the command looks suspicious, shouldn't it be "--id 2"? Nevertheless this needs reproducing, at least it should print an error if it does not delete anything.
Comment 2 Brad Buckingham 2017-10-06 10:57:37 EDT
In the example provided: 
   content-view remove-version --id 2.0 --content-view-version-id 1

the id should be 'content view numeric identifier' according to the command help and not a content view version.

On an internal 6.2.12 instance the following error is generated; however, the error could be improved:

Error: 757: unexpected token at 'The default content view cannot be edited, published, or deleted.'
Comment 3 Brad Buckingham 2017-10-06 11:01:43 EDT
Is the user wanting to delete a content view version from a component content view?  Or remove a content view version from a composite content view?

The command being used above is to remove the version from a composite, according to the help: 

  remove-version  Remove a content view version from a composite view

If they want to remove a version the following commands could be used:

  content-view remove-from-environment
  content-view version delete

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