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

JSONDecodeError on vmanage_device_attachment at viptela.logout() #156

Open
briantsaunders opened this issue Jan 20, 2022 · 3 comments
Open

Comments

@briantsaunders
Copy link

Currently running vManage version 20.4.2.1. Attempting to run module vmanage_device_attachment and the template attachment succeeds but when it hits this point in the code it appears to error out ->

.

This is how I'm calling the module:

    - name: attach customer {{ customer }} device template
      vmanage_device_attachment:
        host: "{{ vmanage_host }}"
        user: "{{ vmanage_user }}"
        password: "{{ vmanage_password }}"
        validate_certs: false
        device: "{{ inventory_hostname }}"
        template: "{{ device_template }}"
        variables: "{{ lookup('template', device_template + '_variables.yaml.j2') | from_yaml }}"
        state: present
        wait: true

This is the error message I receive (truncated to get to the point):

File "/home/saunderb/.ansible/tmp/ansible-tmp-1642707552.1295621-220635-193965079848664/AnsiballZ_vmanage_device_attachment.py", line 47, in invoke_module\n runpy.run_module(mod_name='ansible.modules.vmanage_device_attachment', init_globals=dict(_module_fqn='ansible.modules.vmanage_device_attachment', _modlib_path=modlib_path),\n File "/usr/lib/python3.8/runpy.py", line 207, in run_module\n return _run_module_code(code, init_globals, run_name, mod_spec)\n File "/usr/lib/python3.8/runpy.py", line 97, in _run_module_code\n _run_code(code, mod_globals, init_globals,\n File "/usr/lib/python3.8/runpy.py", line 87, in _run_code\n exec(code, run_globals)\n File "/tmp/ansible_vmanage_device_attachment_payload_5frjq5fl/ansible_vmanage_device_attachment_payload.zip/ansible/modules/vmanage_device_attachment.py", line 233, in \n File "/tmp/ansible_vmanage_device_attachment_payload_5frjq5fl/ansible_vmanage_device_attachment_payload.zip/ansible/modules/vmanage_device_attachment.py", line 230, in main\n File "/tmp/ansible_vmanage_device_attachment_payload_5frjq5fl/ansible_vmanage_device_attachment_payload.zip/ansible/modules/vmanage_device_attachment.py", line 226, in run_module\n File "/tmp/ansible_vmanage_device_attachment_payload_5frjq5fl/ansible_vmanage_device_attachment_payload.zip/ansible/module_utils/viptela.py", line 134, in logout\n File "/tmp/ansible_vmanage_device_attachment_payload_5frjq5fl/ansible_vmanage_device_attachment_payload.zip/ansible/module_utils/viptela.py", line 177, in request\n File "/usr/lib/python3/dist-packages/requests/models.py", line 897, in json\n return complexjson.loads(self.text, **kwargs)\n File "/usr/lib/python3/dist-packages/simplejson/init.py", line 518, in loads\n return _default_decoder.decode(s)\n File "/usr/lib/python3/dist-packages/simplejson/decoder.py", line 370, in decode\n obj, end = self.raw_decode(s)\n File "/usr/lib/python3/dist-packages/simplejson/decoder.py", line 400, in raw_decode\n return self.scan_once(s, idx=_w(s, idx).end())\nsimplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}

If I comment out viptela.logout() the module runs without issue.

@DelmiroCampelo
Copy link

Hi Briant,

I'm running into the same issue as you. When commenting out viptela.out()the module runs fine.

@jasonking3
Copy link
Collaborator

jasonking3 commented Apr 15, 2022

@briantsaunders - I am curious if this is an Ansible version issue. We mainly use the sdwan-devops repo to test the Ansible modules in this repo. It uses ansible==2.10.7. What version are you using?

@DelmiroCampelo
Copy link

Hi @jasonking3 I ran into the same issue using both ansible 2.9.0 and 2.9.6. I would try using 2.10.7 and see if that resolves the issue. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants