-
Notifications
You must be signed in to change notification settings - Fork 897
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
[V2V] Add default credentials to ansible_playbook method #18724
[V2V] Add default credentials to ansible_playbook method #18724
Conversation
…h conversion host in ansible_playbook method.
@miq-bot add_label bug, transformation, hammer/yes |
@jerryk55 oh, good catch, i spaced out on that one. Fixed that while we were here. |
@djberg96 thanks! |
…he ansible_playbook method to use it.
@djberg96 the only issue I see now is that the |
@jerryk55 Ok, I've updated it so that that |
Ok @djberg96 cool. Looks good! |
Fix find credentials for resources where the authentication is associated with the EMS.
I don't think there's any other credentials for conversion host.
Le mar. 7 mai 2019 à 13:02, Daniel Berger <[email protected]> a
écrit :
… ***@***.**** commented on this pull request.
------------------------------
In app/models/conversion_host.rb
<#18724 (comment)>:
> #
- def find_credentials(msg = nil)
- authentication = authentication_type('v2v') ||
- resource.authentication_type('ssh_keypair') ||
- resource.authentication_type('default')
+ def find_credentials(auth_type = nil)
+ authentication = authentication_type(auth_type) || authentication_type('v2v') || authentications.first
@fdupont-redhat <https://github.com/fdupont-redhat> can it be anything
other than 'v2v', 'ssh_keypair' or 'default'?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#18724 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGFAA2E34ZC677FHQFIA5BLPUGYZBANCNFSM4HKWHZUQ>
.
|
Okay so we can drop the |
@agrare Updated the current logic. See if that's ok, or if you think those "or" checks should be dropped completely. |
Checked commits https://github.com/djberg96/manageiq/compare/1840f6cbb873168eadcad3c367b637783a8e10da~...802a13b818a9e78ffcea9f696c91d1f316db6f84 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
Nope. We can default to the 'ssh_keypair' and 'default' as they were used
in previous version. We will probably drop them in Ivanchuk.
Le mar. 7 mai 2019 à 13:53, Adam Grare <[email protected]> a écrit :
… ***@***.**** commented on this pull request.
------------------------------
In app/models/conversion_host.rb
<#18724 (comment)>:
> #
- def find_credentials(msg = nil)
- authentication = authentication_type('v2v') ||
- resource.authentication_type('ssh_keypair') ||
- resource.authentication_type('default')
+ def find_credentials(auth_type = 'v2v')
+ authentication = authentication_type(auth_type) ||
+ authentication_type('ssh_keypair') ||
+ authentication_type('default')
Wait I thought we just said v2v was the only auth type that could be added?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#18724 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGFAA2DFSJM7JRUYG54OUUTPUG6YLANCNFSM4HKWHZUQ>
.
|
@fdupont-redhat okay now you've confused me, is v2v auth type the only one supported or not? |
No, it's not. We support 'v2v' (new, common), as well as 'ssh_keypair'
(legacy, OSP) and 'default' (legacy, RHV).
Le mar. 7 mai 2019 à 14:14, Adam Grare <[email protected]> a écrit :
… @fdupont-redhat <https://github.com/fdupont-redhat> okay now you've
confused me, is v2v auth type the only one supported or not?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#18724 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGFAA2DGRIIWLHIXIYEAUBTPUHBGNANCNFSM4HKWHZUQ>
.
|
Okay but on the conversion host v2v was the only option, ssh_keypair and default we're only for the underlying resource |
You're right. It's a new converged authentication, that makes the graphical configuration easier, and the others, associated to the resource, will disappear in Ivanchuk. |
…ook_default_credentials [V2V] Add default credentials to ansible_playbook method (cherry picked from commit a68811e) Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1694229
Hammer backport details:
|
…le_playbook_default_credentials" This reverts commit e9beef7. https://bugzilla.redhat.com/show_bug.cgi?id=1694229
Reverted the hammer backport:
|
@miq-bot remove_label hammer/no |
@miq-bot add_label hammer/yes |
…ook_default_credentials [V2V] Add default credentials to ansible_playbook method (cherry picked from commit a68811e) https://bugzilla.redhat.com/show_bug.cgi?id=1712135
Re-backported to hammer branch:
|
In the
ansible_playbook
method it's possible that an authentication isn't yet directly associated with the conversion host, e.g. a rhev host without a provided ssh key. This modifies the method so that it callsfind_credentials
as a fallback which will (ultimately) use the authentication of the associated resource.Without this a
undefined method 'userid' for nil:NilClass
error could result.This wasn't caught in the specs because it's a private method. I think our own testing didn't catch it because we were either using openstack or were explicitly providing an ssh key. I personally was just stubbing that method out without checking it. Oops!
This fix also has the added advantage of raising a proper error if it still can't be found for some reason.
BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1622728
Edit: also fixed an error message bug in the
find_credentials
method while we were here.