Description of problem: the command looks like successfully finished "The component version has been removed" but nothing happened, version still present. Version-Release number of selected component (if applicable): @Sat6.2.0 Beta Snap4 How reproducible: always Steps to Reproduce: 1.Create CV 'Custom View' 2.Publish 4x the CV 3.List CV's versions # hammer content-view info --id 3 ... Versions: 1) ID: 3 Version: 1.0 Published: 2016/03/22 09:54:07 2) ID: 4 Version: 2.0 Published: 2016/03/22 09:54:39 3) ID: 5 Version: 3.0 Published: 2016/03/22 10:08:49 4) ID: 6 Version: 4.0 Published: 2016/03/22 10:10:40 ... 4.Try to delete CV version either by id or number using hammer: # hammer content-view remove-version --id 3 --content-view-version-id 6 Warning: Option --id is deprecated. This option will be removed in Katello 2.5, Use --uuid The component version has been removed # hammer content-view remove-version --id 3 --content-view-version 4.0 Warning: Option --id is deprecated. This option will be removed in Katello 2.5, Use --uuid The component version has been removed 5.Check for command result: # hammer content-view info --id 3 ... Versions: 1) ID: 3 Version: 1.0 Published: 2016/03/22 09:54:07 2) ID: 4 Version: 2.0 Published: 2016/03/22 09:54:39 3) ID: 5 Version: 3.0 Published: 2016/03/22 10:08:49 4) ID: 6 Version: 4.0 Published: 2016/03/22 10:10:40 ... Actual results: nothing happened Expected results: specified version is removed
The tools is happy even with non-existent ids/versions: # hammer content-view remove-version --id 3 --content-view-version-id 99999 ... The component version has been removed
*** Bug 1221122 has been marked as a duplicate of this bug. ***
For this bug, we are going to remove the entire "remove-version" option on content-view because it is redundant with "content-view remove" where you can remove multiple versions on a content view. However, currently content-view remove does not seem to be working in hammer, so I am fixing that, and will remove 'remove-version' with that fix.
Please scratch the CM#4 (In reply to Christine Fouant from comment #4) > For this bug, we are going to remove the entire "remove-version" option on > content-view because it is redundant with "content-view remove" where you > can remove multiple versions on a content view. However, currently > content-view remove does not seem to be working in hammer, so I am fixing > that, and will remove 'remove-version' with that fix. Please scratch this comment. There was a miscommunication about the remove-version command.
Upstream bug component is Content Management
(In reply to Lukas Pramuk from comment #0) > Description of problem: > the command looks like successfully finished "The component version has been > removed" but nothing happened, version still present. > > Version-Release number of selected component (if applicable): > @Sat6.2.0 Beta Snap4 > > How reproducible: > always > > Steps to Reproduce: > > 1.Create CV 'Custom View' > > 2.Publish 4x the CV > > 3.List CV's versions > # hammer content-view info --id 3 > ... > Versions: > 1) ID: 3 > Version: 1.0 > Published: 2016/03/22 09:54:07 > 2) ID: 4 > Version: 2.0 > Published: 2016/03/22 09:54:39 > 3) ID: 5 > Version: 3.0 > Published: 2016/03/22 10:08:49 > 4) ID: 6 > Version: 4.0 > Published: 2016/03/22 10:10:40 > ... > > 4.Try to delete CV version either by id or number using hammer: > # hammer content-view remove-version --id 3 --content-view-version-id 6 > Warning: Option --id is deprecated. This option will be removed in Katello > 2.5, Use --uuid > The component version has been removed > > # hammer content-view remove-version --id 3 --content-view-version 4.0 > Warning: Option --id is deprecated. This option will be removed in Katello > 2.5, Use --uuid > The component version has been removed > > 5.Check for command result: > # hammer content-view info --id 3 > ... > Versions: > 1) ID: 3 > Version: 1.0 > Published: 2016/03/22 09:54:07 > 2) ID: 4 > Version: 2.0 > Published: 2016/03/22 09:54:39 > 3) ID: 5 > Version: 3.0 > Published: 2016/03/22 10:08:49 > 4) ID: 6 > Version: 4.0 > Published: 2016/03/22 10:10:40 > ... > > Actual results: > nothing happened > > Expected results: > specified version is removed This is being used incorrectly. The remove-version command is used to remove a component version from a composite view. You are trying to remove a published version from a non-composite view, which is a different command, simply 'remove'. Here is sample output: # hammer content-view info --id 3 --organization-id 1 ID: 3 Name: cv2 Label: cv2 Composite: true Description: Content Host Count: 0 Organization: Default Organization Yum Repositories: Docker Repositories: OSTree Repositories: Puppet Modules: Lifecycle Environments: 1) ID: 4 Name: prod 2) ID: 1 Name: Library Versions: 1) ID: 5 Version: 1.0 Published: 2016/04/18 20:38:36 2) ID: 6 Version: 2.0 Published: 2016/04/18 20:39:22 3) ID: 8 Version: 3.0 Published: 2016/04/19 13:34:01 Components: 1) ID: 4 Name: cv1 3.0 2) ID: 7 Name: cv3 1.0 Activation Keys: Please note, the different versions listed under "Versions" are not removable with the 'remove-version' command. The components which could be removed with 'remove-version' are: Components: 1) ID: 4 Name: cv1 3.0 2) ID: 7 Name: cv3 1.0 # hammer content-view remove-version --id 3 --content-view-version-id 7 The component version has been removed # hammer content-view info --id 3 --organization-id 1ID: 3 Name: cv2 Label: cv2 Composite: true Description: sorry charley Content Host Count: 0 Organization: Default Organization Yum Repositories: Docker Repositories: OSTree Repositories: Puppet Modules: Lifecycle Environments: 1) ID: 4 Name: prod 2) ID: 1 Name: Library Versions: 1) ID: 5 Version: 1.0 Published: 2016/04/18 20:38:36 2) ID: 6 Version: 2.0 Published: 2016/04/18 20:39:22 3) ID: 8 Version: 3.0 Published: 2016/04/19 13:34:01 Components: 1) ID: 4 Name: cv1 3.0 Activation Keys: Please note that content-view-version 7 was removed as a component of this content view. As far as non-existent ids/versions working, the mindset is that since we are disassociating a resource, it should not fail as it yields the same results as it would if the resource did exist: the result being that the component is not associated with the content view.