Bug 1265665 - Hammer content-view remove-version not working, always duplicate numbers
Summary: Hammer content-view remove-version not working, always duplicate numbers
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hammer
Version: 6.1.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: Unspecified
Assignee: Katello Bug Bin
QA Contact: sthirugn@redhat.com
URL:
Whiteboard:
Depends On:
Blocks: 1122832
TreeView+ depends on / blocked
 
Reported: 2015-09-23 12:45 UTC by Peter Vreman
Modified: 2017-02-23 19:45 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-10-02 10:03:54 UTC
Target Upstream Version:
Embargoed:


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


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1265686 0 unspecified CLOSED hammer content-view remove-version confusing with versions subcommand 2021-02-22 00:41:40 UTC

Internal Links: 1265686

Description Peter Vreman 2015-09-23 12:45:57 UTC
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 16:56:51 UTC
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 16:59:19 UTC
@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 07:06:55 UTC
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.