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

hashi_vault - add AppRole deprecation and fix invalid deprecation logic #33

Merged
merged 2 commits into from
Dec 21, 2020

Conversation

briantist
Copy link
Collaborator

SUMMARY

Fixes #32

This started out just being a PR to use the newer hvac auth method class for AppRole, and add our deprecation fallback logic.

But I discovered that logic (which I put in place) only actually works on the positive case (the new auth method is available) and actually fails otherwise, so it was never working as intended 🤦‍♂️.

Took this opportunity to fix that, and make it more pythonic using exception handling instead of hasattr().

Tested with multiple versions of hvac locally to ensure it worked right (we don't [yet] test multiple hvac versions in CI).

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

hashi_vault.py

ADDITIONAL INFORMATION

@briantist briantist added bug Something isn't working enhancement New feature or request labels Dec 20, 2020
@briantist briantist added this to the v0.2.0 milestone Dec 20, 2020
@briantist briantist self-assigned this Dec 20, 2020
@codecov
Copy link

codecov bot commented Dec 20, 2020

Codecov Report

Merging #33 (d471b0a) into main (a4374fd) will decrease coverage by 0.48%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #33      +/-   ##
==========================================
- Coverage   64.15%   63.67%   -0.49%     
==========================================
  Files           1        1              
  Lines         226      234       +8     
  Branches       45       41       -4     
==========================================
+ Hits          145      149       +4     
- Misses         66       71       +5     
+ Partials       15       14       -1     
Impacted Files Coverage Δ
...ommunity/hashi_vault/plugins/lookup/hashi_vault.py 63.67% <0.00%> (-0.49%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a4374fd...d471b0a. Read the comment docs.

@briantist briantist merged commit a40f315 into ansible-collections:main Dec 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

hvac 0.10.6 - AppRole auth method deprecation
2 participants