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

Lastpass lookup failure on python 3 #42062

Closed
dannyim opened this issue Jun 28, 2018 · 3 comments · Fixed by #48804
Closed

Lastpass lookup failure on python 3 #42062

dannyim opened this issue Jun 28, 2018 · 3 comments · Fixed by #48804
Labels
affects_2.6 This issue/PR affects Ansible v2.6 bug This issue/PR relates to a bug. python3 support:community This issue/PR relates to code supported by the Ansible community.

Comments

@dannyim
Copy link

dannyim commented Jun 28, 2018

SUMMARY

Lastpass lookup plugin fails on python 3 due to the subprocess module returning a byte sequence instead of a string.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

lastpass

ANSIBLE VERSION
ansible 2.6.0 (devel 3dee0b67e8) last updated 2018/04/12 14:14:38 (GMT -500)
  config file = None
  configured module search path = ['/home/imxxx021/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /c/Users/imxxx021/wsl/projects/ansible/lib/ansible
  executable location = /c/Users/imxxx021/wsl/projects/ansible/bin/ansible
  python version = 3.5.2 (default, Nov 23 2017, 16:37:01) [GCC 5.4.0 20160609]
CONFIGURATION

ANSIBLE_NOCOLOR(env: ANSIBLE_NOCOLOR) = True

OS / ENVIRONMENT

Ubuntu 16.04.4 LTS via WSL on Windows 10 Enterprise (version 1709)

STEPS TO REPRODUCE
---
- hosts: localhost
  vars:
    maven_username: "{{ lookup('lastpass', 'Artifactory maven account', field='username') }}"
EXPECTED RESULTS

The value of the field from lastpass

ACTUAL RESULTS
fatal: [localhost]: FAILED! => {"msg": "An unhandled exception occurred while running the lookup plugin 'template'. Error was a <class 'ansible.errors.AnsibleError'>, original message: An unhandled exception occurred while templating '{{ lookup('lastpass', 'Artifactory maven account', field='username') }}'. Error was a <class 'ansible.errors.AnsibleError'>, original message: An unhandled exception occurred while running the lookup plugin 'lastpass'. Error was a <class 'TypeError'>, original message: memoryview: a bytes-like object is required, not 'str'"}
@ansibot
Copy link
Contributor

ansibot commented Jun 28, 2018

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibot ansibot added affects_2.6 This issue/PR affects Ansible v2.6 bug This issue/PR relates to a bug. needs_triage Needs a first human triage before being processed. python3 support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Jun 28, 2018
@mkrizek mkrizek removed the needs_triage Needs a first human triage before being processed. label Jun 29, 2018
@ansibot ansibot added support:community This issue/PR relates to code supported by the Ansible community. and removed support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Sep 17, 2018
@alexthemitchell
Copy link

Reproducible in 2.7:

ansible 2.7.0
  config file = None
  configured module search path = ['/Users/alexthemitchell/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/Cellar/ansible/2.7.0/libexec/lib/python3.7/site-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 3.7.0 (default, Jul 23 2018, 20:22:55) [Clang 9.1.0 (clang-902.0.39.2)]

@alexthemitchell
Copy link

Hey @azenk, could you check out this bug?

abadger pushed a commit that referenced this issue Jan 4, 2019
abadger pushed a commit that referenced this issue Jan 9, 2019
Fixes #42062.

(cherry picked from commit 15fb9d3)
kbreit pushed a commit to kbreit/ansible that referenced this issue Jan 11, 2019
@ansible ansible locked and limited conversation to collaborators Jul 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.6 This issue/PR affects Ansible v2.6 bug This issue/PR relates to a bug. python3 support:community This issue/PR relates to code supported by the Ansible community.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants