on content import failure for a repository the created version should be cleaned up
hammer content-import repository failed and left behind a product and repository with no content.
#1 Updated by Partha Aji 4 months ago
During content-import the importing server creates a content-view-version and then tries to import the content into pulp. If the pulp import fails the task errors out. The user then has to remove the content view version and try importing again. Generated content views like repo import based content views will not be visible to the user. So it is not possible for the user to delete the version even if they want to.
On import failure we should instead be just deleting the useless content view version automatically.
Steps to Reproduce:
1. Start a content-view version import task
2. make the import task fail unexpectedly (kill the worker importing it, for example)
3. Notice that the task errors out with a warning
4. Go to Content => Content Views - Content View details of the importing content view
5. Notice that a new content view version got created even though it has no content
6. Try importing again and you notice an error message along the lines of
Content View Version specified in the metadata - '<my content view> 2.0' already exists. If you wish to replace the existing version, delete '<my content view> 2.0' and try import again.
No version created. Since the import did not succeed the generate version should automatically get deleted.