-
Notifications
You must be signed in to change notification settings - Fork 357
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
Fix wrong validation error #1126
Conversation
@miq-bot add_label compute/containers, bug @simon3z @cben @moolitayer @himdel please review |
@miq-bot add_label fine/yes |
@miq-bot add_label blocker |
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.
👍 Closed my #1120 in favor of this.
@moolitayer originally said to catch just the known OpenSSLError, but you're seeing yet another exception Errno::ECONNREFUSED, so now we all agreed we should rescue any exception.
@@ -478,6 +478,9 @@ def get_hostname_from_routes(ems, endpoint_hash, token) | |||
rescue KubeException, OpenSSL::SSL::SSLError => e | |||
$log.warn("MIQ(#{controller_name}_controller-#{action_name}): get_hostname_from_routes error: #{e}") | |||
nil | |||
rescue StandardError |
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.
you can write just rescue
, it default to StandardError.
and you'll need => e
to log the error.
@@ -478,6 +478,9 @@ def get_hostname_from_routes(ems, endpoint_hash, token) | |||
rescue KubeException, OpenSSL::SSL::SSLError => e |
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.
If you're keeping this separate to log "error" vs "unexpected error", consider upgrading to OpenSSL::OpenSSLError
(see #1120 explanation).
e580346
to
64d5985
Compare
@cben Thanks 👍 fixed |
Checked commit yaacov@64d5985 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
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'm working on a related fix for:
https://bugzilla.redhat.com/show_bug.cgi?id=1437138
However this solves:
https://bugzilla.redhat.com/show_bug.cgi?id=1441670
https://bugzilla.redhat.com/show_bug.cgi?id=1443520
@simon3z please review |
Agreed, makes sense to catch any errors, not just the expected ones :). Tested in the UI, the usual ones (timeout, refused) still work as expected. |
Fix wrong validation error (cherry picked from commit d63ee8f) https://bugzilla.redhat.com/show_bug.cgi?id=1445002 https://bugzilla.redhat.com/show_bug.cgi?id=1441670
@simaishi We'd like this backported for tomorrow build (BZ 1441670 is 5.8 blocker+ clone of BZ 1436221) |
Fine backport details:
|
Description
Fix validation success when port is wrong
Screenshots
Bug
FIx
BZ:
https://bugzilla.redhat.com/show_bug.cgi?id=1443520