-
Notifications
You must be signed in to change notification settings - Fork 898
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
Raise a notification for each repo that fails to enable #18290
Raise a notification for each repo that fails to enable #18290
Conversation
Checked commit carbonin@c25631a with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
@@ -136,6 +136,7 @@ def enable_repos | |||
LinuxAdmin::SubscriptionManager.enable_repo(repo, assemble_registration_options) | |||
rescue AwesomeSpawn::CommandResultError | |||
update_attributes(:upgrade_message => "failed to enable #{repo}") | |||
Notification.create(:type => "enable_update_repo_failed", :options => {:repo_name => repo}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I don't know if we can bubble up more information out of the exception but that might be too much information. Either way, that's more than what you need here.
@@ -285,6 +285,11 @@ | |||
:expires_in: 24.hours | |||
:level: :error | |||
:audience: superadmin | |||
- :name: enable_update_repo_failed | |||
:message: 'Subscription Manager failed to enable repo %{repo_name}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like how we're consistently inconsistent with putting periods at the end of the message. 🤣
|
||
it "raises a notification for repos which fail to enable" do | ||
NotificationType.seed | ||
result = AwesomeSpawn::CommandResult.new("stuff", "things", "more things", 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I approve of this command.
Raise a notification for each repo that fails to enable (cherry picked from commit 1eb52ea) Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1518801
Hammer backport details:
|
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1518801