Skip to content
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

Bug fix: Warns user if incorrect SDK version is installed #4422

Merged
merged 5 commits into from Apr 5, 2022
Merged

Bug fix: Warns user if incorrect SDK version is installed #4422

merged 5 commits into from Apr 5, 2022

Conversation

EndlessTrax
Copy link
Contributor

SUMMARY

This raises an error if the wrong python-dsv-sdk version is installed. This lookup plugin currently only supports v0.0.1 of the SDK. This is a temporary fix until full support with the latest SDK version can be developed.

(Re-submitted with clean git history)

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

dsv lookup plugin

ADDITIONAL INFORMATION

Before the fix, the error presented to the user:

Error was a <class 'ansible.errors.AnsibleError'>, original message: An unhandled exception occurred while running the lookup plugin 'community.general.dsv'. Error was a <class 'TypeError'>, original message: __init__() got an unexpected keyword argument 'tenant'"}

After:

Error was a <class 'ansible.errors.AnsibleError'>, original message: python-dsv-sdk==0.0.1 must be installed to use this plugin"}

@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added bug This issue/PR relates to a bug lookup lookup plugin plugins plugin (any type) labels Mar 29, 2022
Copy link
Collaborator

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution! Can you add a changelog fragment? Thanks.

plugins/lookup/dsv.py Outdated Show resolved Hide resolved
@felixfontein felixfontein added check-before-release PR will be looked at again shortly before release and merged if possible. backport-3 labels Mar 29, 2022
@ansibullbot

This comment was marked as outdated.

@ansibullbot ansibullbot added ci_verified Push fixes to PR branch to re-run CI needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR labels Mar 29, 2022
@ansibullbot ansibullbot removed the ci_verified Push fixes to PR branch to re-run CI label Mar 29, 2022
@EndlessTrax
Copy link
Contributor Author

Thanks for your contribution! Can you add a changelog fragment? Thanks.

Added. Also changed the bare exception as suggested. Thanks for the review.

Co-authored-by: Felix Fontein <felix@fontein.de>
@felixfontein felixfontein merged commit e7ffa76 into ansible-collections:main Apr 5, 2022
@patchback
Copy link

patchback bot commented Apr 5, 2022

Backport to stable-3: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-3/e7ffa76db6dd3e27a9891c06c0356a9899856548/pr-4422

Backported as #4449

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

@felixfontein felixfontein removed the check-before-release PR will be looked at again shortly before release and merged if possible. label Apr 5, 2022
patchback bot pushed a commit that referenced this pull request Apr 5, 2022
* Add error handling to check correct SDK version installed

* Fix CI errors

* Added changelog fragment

* Changed exeption type

* Update changelogs fragment

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit e7ffa76)
@felixfontein
Copy link
Collaborator

@EndlessTrax thanks for fixing this!

@patchback
Copy link

patchback bot commented Apr 5, 2022

Backport to stable-4: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-4/e7ffa76db6dd3e27a9891c06c0356a9899856548/pr-4422

Backported as #4450

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Apr 5, 2022
* Add error handling to check correct SDK version installed

* Fix CI errors

* Added changelog fragment

* Changed exeption type

* Update changelogs fragment

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit e7ffa76)
felixfontein pushed a commit that referenced this pull request Apr 5, 2022
)

* Add error handling to check correct SDK version installed

* Fix CI errors

* Added changelog fragment

* Changed exeption type

* Update changelogs fragment

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit e7ffa76)

Co-authored-by: Ricky White <rickywhite@outlook.com>
felixfontein pushed a commit that referenced this pull request Apr 5, 2022
)

* Add error handling to check correct SDK version installed

* Fix CI errors

* Added changelog fragment

* Changed exeption type

* Update changelogs fragment

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit e7ffa76)

Co-authored-by: Ricky White <rickywhite@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug lookup lookup plugin needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR plugins plugin (any type)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants