-
Notifications
You must be signed in to change notification settings - Fork 62
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 Miq exceptions on connect #162
Conversation
@jhernand will you please take a look. |
rescue | ||
_log.error("Error while verifying credentials #{$ERROR_INFO}") | ||
raise MiqException::MiqEVMLoginError, $ERROR_INFO | ||
end | ||
|
||
def rethrow_as_a_miq_error(e) | ||
if e.message.include?("The username or password is incorrect") |
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'd suggest to write here a comment (maybe a TODO) explaining that in version 4.2 of the SDK there will be specific exceptions for these cases. Once we update to 4.2 this should be modified to use those exceptions instead of this fragile string checking.
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 will create a git issue once this is merged, I think its easier to track than a TODO in the code.
Also added a trello card in backlog.
please do not merge yet |
@borod108 unrecognized command 'add-lable', ignoring... Accepted commands are: add_label, assign, close_issue, move_issue, remove_label, rm_label, set_milestone |
aec6130
to
51f4a49
Compare
The `raw_connect` method of providers is intended to check connection and authentication details. This method should report errors throwing instances of `MiqEVMLoginError`, `MiqInvalidCredentialsError`, etc. This fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1510374
51f4a49
to
4a70f08
Compare
Checked commit borod108@4a70f08 with ruby 2.3.3, rubocop 0.47.1, haml-lint 0.20.0, and yamllint 1.10.0 |
@masayag will you take a look and merge? |
@miq-bot add_labels bug, Gaprindashvili/yes |
Raise Miq exceptions on connect (cherry picked from commit 7d33f02) https://bugzilla.redhat.com/show_bug.cgi?id=1519815
Gaprindashvili backport details:
|
1 similar comment
@borod108 unrecognized command 'add-lable', ignoring... Accepted commands are: add_label, assign, close_issue, move_issue, remove_label, rm_label, set_milestone |
The
raw_connect
method of providers is intended to check connection and authentication details.This method should report errors throwing instances of
MiqEVMLoginError
,MiqInvalidCredentialsError
, etc.This fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1510374