mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-03-26 21:33:12 +00:00
fixes #7918 - onepassword lookup fails if field name contains uppercase letters and section is specified (#7919)
* fix #7918 * Update plugins/lookup/onepassword.py Co-authored-by: Sam Doran <github@samdoran.com> * onepassword lookup: transform field ids to lowercase * #7918: added unit tests * #7919: add changelog fragment * Update changelogs/fragments/7919-onepassword-fieldname-casing.yaml Co-authored-by: Felix Fontein <felix@fontein.de> --------- Co-authored-by: Sam Doran <github@samdoran.com> Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
@@ -489,10 +489,10 @@ class OnePassCLIv2(OnePassCLIBase):
|
||||
current_section_title = section.get("label", section.get("id", "")).lower()
|
||||
if section_title == current_section_title:
|
||||
# In the correct section. Check "label" then "id" for the desired field_name
|
||||
if field.get("label") == field_name:
|
||||
if field.get("label", "").lower() == field_name:
|
||||
return field.get("value", "")
|
||||
|
||||
if field.get("id") == field_name:
|
||||
if field.get("id", "").lower() == field_name:
|
||||
return field.get("value", "")
|
||||
|
||||
return ""
|
||||
|
||||
Reference in New Issue
Block a user