Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes #15811 - product destroy - update error messages on failure #6208

Merged
merged 1 commit into from
Aug 3, 2016

Conversation

bbuckingham
Copy link
Member

This commit provides more specific error messages when
attempting to delete a product that is not allowed.

Below are a couple of examples using the hammer-cli-katello:

hammer> product delete --id 2
Could not destroy the product:
  Cannot delete product with repositories published in a
  content view.  Product: zoo, Content Views: view1, view2, view3

hammer> product delete --id 51
Could not destroy the product:
  Cannot delete Red Hat product: Red Hat Enterprise Linux Server

hammer> product delete --id 3
Product destroyed

@jlsherrill
Copy link
Member

@bbuckingham for the case of:

  Cannot delete product with repositories published in a
  content view.  Product: zoo, Content Views: view1, view2, view3

I've heard the real complaint isn't necessarily the view, but which versions of the view. If the user has a bunch of versions they have to click through each one to figure it out. Could you enhance this to provide that information?

@bbuckingham
Copy link
Member Author

@jlsherrill, I can. The bug description asked explicitly for content view names, but we can certainly include version info as well.

Are you thinking something like : view1 version 1.0, 1.2, view2 version 2.0, 2.1, view 3 version 1.1 ?

@jlsherrill
Copy link
Member

@bbuckingham right, I just recently had to right a custom rails console script for a user to tell them which versions to delete as they had probably 150 versions across many views (and like 5 versions had the repository in it). I think that wording is fine.

@theforeman-bot
Copy link

There were the following issues with the commit message:

  • cafd641aeae9b2f6ad15bef74ff0fe58147a162a must be in the format fixes #redmine_number - brief description

If you don't have a ticket number, please create an issue in Redmine, selecting the appropriate project.

More guidelines are available in Coding Standards or on the Foreman wiki.


This message was auto-generated by Foreman's prprocessor

@bbuckingham
Copy link
Member Author

@jlsherrill, Updated. The new format would look similar to the following:

hammer> product delete --id 51
Could not destroy the product:
  Cannot delete Red Hat product: Red Hat Enterprise Linux Server

hammer> product delete --id 1
Could not destroy the product:
  Cannot delete product with repositories published in a content view.  Product: capsule-el7, Content View view1: Versions: 1.0, 2.0, Content View view2: Versions: 1.0, Content View view3: Versions: 5.0
hammer> 

@jlsherrill
Copy link
Member

Overall LGTM, i'll do a final test once rubocop is happy

This commit provides more specific error messages when
attempting to delete a product that is not allowed.

Below are a couple of examples using the hammer-cli-katello:

hammer> product delete --id 2
Could not destroy the product:
  Cannot delete product with repositories published in a
  content view.  Product: zoo, Content Views: view1, view2, view3

hammer> product delete --id 51
Could not destroy the product:
  Cannot delete Red Hat product: Red Hat Enterprise Linux Server

hammer> product delete --id 3
Product destroyed
@bbuckingham
Copy link
Member Author

Busted by rubocop.... Updated :)

@jlsherrill
Copy link
Member

ACK

@bbuckingham bbuckingham merged commit 76cf0da into Katello:master Aug 3, 2016
@bbuckingham bbuckingham deleted the issue-15811 branch August 3, 2016 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants