-
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
Try both API versions in raw_connect
#132
Try both API versions in raw_connect
#132
Conversation
@borod108 @masayag @pkliczewski @jntullo please review. If/when this is merged we will be able to remove the |
v4_connection.test(raise_exception=true) | ||
rescue Exception => exception | ||
v4_error = exception | ||
end |
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.
Why not to have ensure here as for v3 below? Do we want to keep it open?
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 saw the comment. Please ignore
@jhernand Can we fix codeclimate comments? |
@jhernand why can't we use probing with queue? something like https://github.com/ManageIQ/manageiq-providers-ovirt/pull/111/files#diff-4d8ab13ae69c2eade9d82675975c0defR56 |
@pkliczewski in the new version of the pull request I tried to address the style issues. @borod108 probing via a queued request would mean two queued request, as the original call to |
@miq-bot add_label wip I didn't test this with oVirt 3 yet, so please don't merge. |
raw_connect
raw_connect
@jhernand Looks good to me, is it still WIP? |
@pkliczewski yes, it is work in progress, I need to test that it works correctly with oVirt 3.6. |
raw_connect
raw_connect
@miq-bot remove_label wip Did some important changes to make this work with both versions of the API. I verified that it works correctly now for oVirt 4 and oVirt 3. However, I also detected that the regression also affects the validation of the details of the C&U metrics endpoint. I am working on that. I'd suggest to merge this as a first step. |
@jhernand I'll merge once ci finishes. |
Please don't merge, checking the connection works, but using it doesn't :-( . |
@jhernand confirmed this works for validation but not for normal connections. Looks like just fallout from moving a number of methods to class methods, let me know if there is anything I can do to help. |
@agrare would be nice if you can take a look and help find the right Ruby way to call the |
@jhernand you're right about Try with this patch:
|
@agrare |
@jhernand I had an issue with them being private when calling
Is this logic that we could move into the |
@agrare the name resolution logic can't be moved to the |
@agrare you were right about the need to remove the |
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.
This looks good to me, just need to get the tests passing.
Currently the `raw_connect` method needs to receive the version of the API in order to work correctly. If it doesn't receive it it fails because the method that determines it just doesn't exist (it is an instance method, but `raw_connect` is a class method). To avoid that this patch changes the `raw_connect` method so that it tries with both versions of the API. This patch fixes partially the following bug: Failed validation when adding RHV provider https://bugzilla.redhat.com/1509432
Checked commit https://github.com/jhernand/manageiq-providers-ovirt/commit/30bf6a128a42b11813f383abf04861900111f25e with ruby 2.3.3, rubocop 0.47.1, and haml-lint 0.20.0 |
Dear reviewers, this is now, to the best of my understanding, working with oVirt 3 and oVirt 4, and it passes the tests. Please re-review. |
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.
👍 thanks so much @jhernand !
…nnect Try both API versions in `raw_connect` (cherry picked from commit cb185fc) https://bugzilla.redhat.com/show_bug.cgi?id=1510504
Gaprindashvili backport details:
|
Currently the
raw_connect
method needs to receive the version of theAPI in order to work correctly. If it doesn't receive it it fails
because the method that determines it just doesn't exist (it is an
instance method, but
raw_connect
is a class method). To avoid thatthis patch changes the
raw_connect
method so that it tries with bothversions of the API.
This patch fixes partially the following bug:
Failed validation when adding RHV provider
https://bugzilla.redhat.com/1509432