Bug 1265665 - Hammer content-view remove-version not working, always duplicate numbers
Hammer content-view remove-version not working, always duplicate numbers
Status: CLOSED NOTABUG
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Hammer (Show other bugs)
6.1.2
Unspecified Unspecified
unspecified Severity unspecified (vote)
: Unspecified
: --
Assigned To: Katello Bug Bin
sthirugn@redhat.com
:
Depends On:
Blocks: 1122832
  Show dependency treegraph
 
Reported: 2015-09-23 08:45 EDT by Peter Vreman
Modified: 2017-02-23 14:45 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-10-02 06:03:54 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Hammer debug output of content-view remove-version (57.89 KB, text/plain)
2015-09-23 08:45 EDT, Peter Vreman
no flags Details

  None (edit)
Description Peter Vreman 2015-09-23 08:45:57 EDT
Created attachment 1076217 [details]
Hammer debug output of content-view remove-version

Description of problem:
Hammer content-view remove-version is not working, because it finds duplicate version numbers.

[ERROR 2015-09-23 12:40:59 Exception] Error: content_view_version found more than once
Could not remove version:
  Error: content_view_version found more than once
[ERROR 2015-09-23 12:40:59 Exception]


The reason is that hammer queries all content-view-versions having a value provided by --content-view-version without filtering on the provided --name parameter

See the attached output of hammer --debug for details

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


How reproducible:


Steps to Reproduce:
1. Create 4 ContentViews A,B,C and D
2. Publish the 4 ContentViews 3 times
3. Delete content view version 1 of Content View A using Hammer

Actual results:
Content view version is not removed


Expected results:
Content view version is removed

Additional info:
Comment 2 sthirugn@redhat.com 2015-09-29 12:56:51 EDT
hammer> content-view create --name=cv1 --repository-ids=690 --organization-id=1
Content view created
hammer> content-view create --name=cv2 --repository-ids=690 --organization-id=1
Content view created
hammer> content-view create --name=cv3 --repository-ids=690 --organization-id=1
Content view created
hammer> content-view create --name=cv4 --repository-ids=690 --organization-id=1
Content view created
hammer> content-view publish --name=cv1 --organization-id=1
[........................................................] [100%]

hammer> content-view publish --name=cv1 --organization-id=1
[........................................................] [100%]

hammer> content-view publish --name=cv1 --organization-id=1
[........................................................] [100%]

hammer> content-view publish --name=cv2 --organization-id=1
[........................................................] [100%]

hammer> content-view publish --name=cv2 --organization-id=1
[........................................................] [100%]

hammer> content-view publish --name=cv2 --organization-id=1
[........................................................] [100%]

hammer> content-view publish --name=cv3 --organization-id=1
[........................................................] [100%]

hammer> content-view publish --name=cv3 --organization-id=1
[........................................................] [100%]

hammer> content-view publish --name=cv3 --organization-id=1
[........................................................] [100%]

hammer> content-view publish --name=cv4 --organization-id=1
[........................................................] [100%]

hammer> content-view publish --name=cv4 --organization-id=1
[........................................................] [100%]

hammer> content-view publish --name=cv4 --organization-id=1
[........................................................] [100%]

hammer> content-view version delete --version=1.0 --organization-id=1
Could not delete the content view:
  Error: content_view_version found more than once

hammer> content-view version delete --version=1.0 --organization-id=1 --content-view=cv1
[........................................................] [100%]

hammer> content-view version delete --id=424
[........................................................] [100%]
Comment 3 sthirugn@redhat.com 2015-09-29 12:59:19 EDT
@Peter:
Can you please paste the hammer command which you used to get this error?

You can see from my Comment 2 that the delete works in two scenarios. It failed only when I passed the version and did not pass the content view name.
Comment 4 Peter Vreman 2015-10-02 03:06:55 EDT
The issue was that i tried to use the command 'remove-version' instead of 'version delete' to delete a single contentviewversion of the contentview

hammer --debug -c /opt/hoici/etc/sat6/hammer-hoici.yaml content-view remove-version  --organization-id=3 --name='product-HOIPRODUCTS-1.1.0-ci' --content-view-version=4

I have created BZ1265686 for this confusing naming of 'remove-version' vs. 'version delete'

This case can be closed

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