"hammer content-view remove" - cannot delete version while it is in environment Library
The following CLI command :
hammer content-view remove --content-view-version-ids $VID --name "$CONTENT_V_NAME" $ORG
tells :
Could not remove objects from content view:
Cannot delete version while it is in environment Library
If I try the same through web console, I have the following option
**Completely remove version? **
and permit the deletion.
What’s the way to get this option with hammer CLI ?
Responses
Sure you can!You need to remove the Library environment from the content view. Just check your organization ID first, here I use for example 3, you can use
hammer organization list
1)List all your content view
hammer content-view version list
2)Remove it from the Library
hammer content-view remove-from-environment --id "CV ID" --lifecycle-environment Library --organization-id 3
3)Now you can delete the content view
hammer content-view delete --id "CV ID" --organization-id 3
Pascal,
Can you please clarify what it is you are trying to do? From the discussion so far I am unsure if you are trying to delete the entire content view from the Library environment, or only delete a specific version of a content view.
In your most recent comment you listed the available versions of the content view RHEL7.4 x86_64 security per month, but in the next command you provide the version's ID, not the content view's ID. I believe that is why hammer responded with the following message:
Couldn't find Katello::ContentView with 'id'=213
This message indicates that there is no content view with an ID of 213. In your last example command, where you mention the content view by --name, hammer knows to which content view you are referring. However, that will remove the entire content view from the Library environment. It's not dangerous to do so, if that is what you are trying to do.
If you can clarify what it is you are trying to do, I'm sure we can find a solution.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
