-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
onepassword: ignore errors from "op account get" #5942
onepassword: ignore errors from "op account get" #5942
Conversation
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 for your contribution! Can you please add a changelog fragment? Thanks.
I've updated the previous changelog fragment. |
This change looks correct. Thank you very much for fixing this. |
@gmarcy It doesn't look like there is a changeling fragment in this PR. You'll need to make a new file in |
oh, separate file. I put it inline in the PR summary. sorry, first PR here, missed that nuance. |
changelogs/fragments/5942-onepassword-ignore-errors-from-op-account-get.yml
Outdated
Show resolved
Hide resolved
…count-get.yml Co-authored-by: Felix Fontein <[email protected]>
Backport to stable-5: 💔 cherry-picking failed — conflicts found❌ Failed to cleanly apply 5648e0e on top of patchback/backports/stable-5/5648e0e2aff5ac1c677dc9047c332498d595dc45/pr-5942 Backporting merged PR #5942 into main
🤖 @patchback |
Backport to stable-6: 💚 backport PR created✅ Backport PR branch: Backported as #6037 🤖 @patchback |
* ignore errors from "op account get" * add changelog fragment * Update changelogs/fragments/5942-onepassword-ignore-errors-from-op-account-get.yml Co-authored-by: Felix Fontein <[email protected]> --------- Co-authored-by: Felix Fontein <[email protected]> (cherry picked from commit 5648e0e)
Docs Build 📝Thank you for contribution!✨ This PR has been merged and your docs changes will be incorporated when they are next published. |
…m "op account get" (#6037) onepassword: ignore errors from "op account get" (#5942) * ignore errors from "op account get" * add changelog fragment * Update changelogs/fragments/5942-onepassword-ignore-errors-from-op-account-get.yml Co-authored-by: Felix Fontein <[email protected]> --------- Co-authored-by: Felix Fontein <[email protected]> (cherry picked from commit 5648e0e) Co-authored-by: Glenn Marcy <[email protected]>
Hmm, for some reasons the unit tests were not running in this PR. Merging this PR thus broke CI (since the tests now fail). I've created a PR to fix this (#6041), but we definitely have to figure out why change detection does not let these tests run... |
Looking at the ansible-test sources, it seems that the directory scheme used was never supported for plugins such as lookup plugins. All unit tests for lookup plugin foo have to be in I'll create a PR to re-arrange them. |
#6075 fixes this. |
…#5942) * ignore errors from "op account get" * add changelog fragment * Update changelogs/fragments/5942-onepassword-ignore-errors-from-op-account-get.yml Co-authored-by: Felix Fontein <[email protected]> --------- Co-authored-by: Felix Fontein <[email protected]>
SUMMARY
When using the onepassword lookup plugin, part of the flow is to determine if you are signed in. This is performed in an api version specific function called assert_logged_in() documented as "Check whether a login session exists" which uses the command
op account get
. When you are not in fact signed in, this cli can return an error which is currently not ignored and can cause the lookup plugin to fail at that point rather than correctly returning the status to indicate that you are not signed in and proceed to signin using the parameters passed for that purpose.This change passes the
ignore_errors=True
parameter to the _run function so that the return code can be used to indicate you are not signed in when an error occurs.changelog fragment
bugfixes:
ISSUE TYPE
COMPONENT NAME
plugins/lookup/onepassword.py
ADDITIONAL INFORMATION
ansible task
before fix applied
after fix applied
cli behavior when not signed in