ManageIQ / manageiq-providers-cisco_intersight

ManageIQ provider for Cisco Intersight
Apache License 2.0
2 stars 15 forks source link

Refactor IntersightClient ApiClient usage #45

Closed agrare closed 2 years ago

agrare commented 2 years ago

Rather than setting IntersightClient::Configuration.@@default we can initialize a IntersightClient::Configuration object, set the key and key_id, and build an IntersightClient::ApiClient based on that

Fixes https://github.com/ManageIQ/manageiq-providers-cisco_intersight/issues/44

agrare commented 2 years ago

Hey @gberginc I wonder if you guys could test this out as I don't have access to an intersight provider? Thanks!

ghost commented 2 years ago

Sure @agrare .

I got error when checking authentication using command authentication_check on the provider, blocking also the other functionalities since credentials aren't verified:

image

From the rails console, get this error if it helps additionally:

image
agrare commented 2 years ago

Ah thanks @tjazsch that is because the existing verify_provider_credentials method is self. in the mixin and not in the ClassMethods section, will move it to the right place

ghost commented 2 years ago

Sure. Will be able test code again in 90 minutes if there will be any further commits.

agrare commented 2 years ago

Okay moved into the ClassMethods section and I am able to verify (unsuccessfully, but for successful reasons :laughing:)

ghost commented 2 years ago

Sorry for the later response than expected. All functionalities this refactoring touches look good @agrare !

So I tried the following operations on the provider. All were executed successfully:

Nevertheless, @gberginc still needs to approve the PR.

agrare commented 2 years ago

That's awesome thanks for the testing @tjazsch really appreciate it

ghost commented 2 years ago

Thank you for doing the refactoring 😎. Appreciated.

miq-bot commented 2 years ago

Checked commits https://github.com/agrare/manageiq-providers-cisco_intersight/compare/9704bdacaec51961952b1e86c54c30f84a20cb18~...776589e562f86d743464a39d9c9c3da2d07f1e4e with ruby 2.6.9, rubocop 1.19.1, haml-lint 0.35.0, and yamllint 5 files checked, 0 offenses detected Everything looks fine. :cake: