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

adding nested try block for tss.py to import new Delinea library #5151

Merged
merged 5 commits into from Aug 23, 2022

Conversation

tomreeb
Copy link
Contributor

@tomreeb tomreeb commented Aug 23, 2022

SUMMARY

Thycotic has changed names to Delinea, as such the developers of the thycotic-tss-sdk package have updated their library. The latest version, 1.2.0, renamed the module from thycotic to delinea. This update breaks the tss.py lookup plugin because it no longer can import thycotic.secrets.server. I've added a nested try: block to the code to attempt to import delinea.secrets.server if thycotic.secrets.server fails. This maintains backwards compatibility with older versions on the library.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

tss.py

ADDITIONAL INFORMATION

Without this fix, the plugin would generate the following error:

fatal: [localhost]: FAILED! => {"msg": "An unhandled exception occurred while templating '{{ lookup('community.general.tss', 12345) }}'. Error was a <class 'ansible.errors.AnsibleError'>, original message: An unhandled exception occurred while running the lookup plugin 'community.general.tss'. Error was a <class 'ansible.errors.AnsibleError'>, original message: python-tss-sdk must be installed to use this plugin. python-tss-sdk must be installed to use this plugin"}

@tomreeb tomreeb mentioned this pull request Aug 23, 2022
@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added bug This issue/PR relates to a bug lookup lookup plugin new_contributor Help guide this first time contributor plugins plugin (any type) labels Aug 23, 2022
@ansibullbot

This comment was marked as outdated.

@ansibullbot ansibullbot added ci_verified Push fixes to PR branch to re-run CI has_issue needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR labels Aug 23, 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. Could you please add a changelog fragment? Thanks.

plugins/lookup/tss.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-4 labels Aug 23, 2022
Co-authored-by: Felix Fontein <felix@fontein.de>
@ansibullbot ansibullbot removed the ci_verified Push fixes to PR branch to re-run CI label Aug 23, 2022
@tomreeb
Copy link
Contributor Author

tomreeb commented Aug 23, 2022

Thanks for your contribution. Could you please add a changelog fragment? Thanks.

Added a changelog fragment.

@ansibullbot ansibullbot removed the needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR label Aug 23, 2022
@tylerezimmerman
Copy link
Contributor

@felixfontein all issues have been resolved. Can this be approved and merged?

Co-authored-by: Felix Fontein <felix@fontein.de>
This was referenced Nov 20, 2022
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 has_issue lookup lookup plugin new_contributor Help guide this first time contributor plugins plugin (any type)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants