ansible-junos-stdlib icon indicating copy to clipboard operation
ansible-junos-stdlib copied to clipboard

JuniperJunosModule' object has no attribute '_pyez_conn'

Open achhabr1 opened this issue 3 years ago • 13 comments

Issue Type

  • Bug Report

Module Name

facts

juniper.device collection and Python libraries version (python3-venv) [ac043s@sdnautosr12 juniper]$ pip list Package Version


ansible 4.2.0 ansible-core 2.11.2 bcrypt 3.2.0 cffi 1.14.5 colorama 0.4.4 configparser 5.0.2 cryptography 3.4.7 future 0.18.2 icdiff 1.9.1 Jinja2 3.0.1 jsnapy 1.3.6 junos-eznc 2.6.1 jxmlease 1.0.3 lxml 4.6.3 MarkupSafe 2.0.1 ncclient 0.6.9 netaddr 0.8.0 netmiko 3.4.0 ntc-templates 2.1.0 packaging 21.0 paramiko 2.7.2 pip 21.1.3 pycparser 2.20 PyNaCl 1.4.0 pyparsing 2.4.7 pyserial 3.5 PyYAML 5.4.1 resolvelib 0.5.4 scp 0.13.5 setuptools 41.6.0 six 1.16.0 tenacity 7.0.0 textfsm 1.1.2 transitions 0.8.8 xmltodict 0.12.0 yamlordereddictloader 0.4.0 (python3-venv) [ac043s@sdnautosr12 juniper]$

OS / Environment Porter 3

Summary Connection not happening new ansible 4.2.0

(python3-venv) [ac043s@sdnautosr12 juniper]$ python Python 3.8.6 (default, Jan 22 2021, 11:41:28) [GCC 8.4.1 20200928 (Red Hat 8.4.1-1)] on linux Type "help", "copyright", "credits" or "license" for more information.

Playbook `---

  • name: Install Junos OS hosts: porter3 connection: juniper.device.pyez gather_facts: no collections:

    • juniper.device

    vars: OS_version: "21.1R1-S1.1" OS_package: "jinstall-host-nfx-3-x86-64-21.1R1-S1.1-secure-signed.tgz" pkg_dir: "{{ lookup('env', 'HOME') }}/images" log_dir: "{{ lookup('env', 'HOME') }}/log" netconf_port: 830 wait_time: 3600 ansible_python_interpreter: "{{ lookup('env', 'HOME') }}/python3-venv/bin/python"

    tasks:

    • name: Checking NETCONF connectivity wait_for: host: "{{ inventory_hostname }}" port: "{{ netconf_port }}" timeout: 5

    • name: Get device facts facts: `

Verbose output of the Error

TASK [Get device facts] *************************************************************************************************************************************************************************************** task path: /home/ac043s/software_sdnautos02/ansible_development/juniper/porter3upgrade.yml:25 redirecting (type: connection) ansible.builtin.netconf to ansible.netcommon.netconf Loading collection ansible.netcommon from /home/ac043s/python3-venv/lib64/python3.8/site-packages/ansible_collections/ansible/netcommon redirecting (type: netconf) ansible.builtin.junos to junipernetworks.junos.junos Loading collection junipernetworks.junos from /home/ac043s/python3-venv/lib64/python3.8/site-packages/ansible_collections/junipernetworks/junos attempting to start connection using connection plugin ansible.netcommon.netconf Found ansible-connection at path /home/ac043s/python3-venv/bin/ansible-connection found existing local domain socket, using it! local domain socket path is /home/ac043s/.ansible/pc/5ecf442b60 ESTABLISH LOCAL CONNECTION FOR USER: ac043s EXEC /bin/sh -c '( umask 77 && mkdir -p "echo /home/ac043s/.ansible/tmp/ansible-local-29214wabu3363"&& mkdir "echo /home/ac043s/.ansible/tmp/ansible-local-29214wabu3363/ansible-tmp-1625602138.1041296-29252-272465699950870" && echo ansible-tmp-1625602138.1041296-29252-272465699950870="echo /home/ac043s/.ansible/tmp/ansible-local-29214wabu3363/ansible-tmp-1625602138.1041296-29252-272465699950870" ) && sleep 0' Using module file /home/ac043s/.ansible/collections/ansible_collections/juniper/device/plugins/modules/facts.py PUT /home/ac043s/.ansible/tmp/ansible-local-29214wabu3363/tmpggveq12s TO /home/ac043s/.ansible/tmp/ansible-local-29214wabu3363/ansible-tmp-1625602138.1041296-29252-272465699950870/AnsiballZ_facts.py EXEC /bin/sh -c 'chmod u+x /home/ac043s/.ansible/tmp/ansible-local-29214wabu3363/ansible-tmp-1625602138.1041296-29252-272465699950870/ /home/ac043s/.ansible/tmp/ansible-local-29214wabu3363/ansible-tmp-1625602138.1041296-29252-272465699950870/AnsiballZ_facts.py && sleep 0' EXEC /bin/sh -c '/home/ac043s/python3-venv/bin/python /home/ac043s/.ansible/tmp/ansible-local-29214wabu3363/ansible-tmp-1625602138.1041296-29252-272465699950870/AnsiballZ_facts.py && sleep 0' EXEC /bin/sh -c 'rm -f -r /home/ac043s/.ansible/tmp/ansible-local-29214wabu3363/ansible-tmp-1625602138.1041296-29252-272465699950870/ > /dev/null 2>&1 && sleep 0' The full traceback is: Traceback (most recent call last): File "/home/ac043s/.ansible/tmp/ansible-local-29214wabu3363/ansible-tmp-1625602138.1041296-29252-272465699950870/AnsiballZ_facts.py", line 100, in _ansiballz_main() File "/home/ac043s/.ansible/tmp/ansible-local-29214wabu3363/ansible-tmp-1625602138.1041296-29252-272465699950870/AnsiballZ_facts.py", line 92, in _ansiballz_main invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS) File "/home/ac043s/.ansible/tmp/ansible-local-29214wabu3363/ansible-tmp-1625602138.1041296-29252-272465699950870/AnsiballZ_facts.py", line 40, in invoke_module runpy.run_module(mod_name='ansible_collections.juniper.device.plugins.modules.facts', init_globals=dict(_module_fqn='ansible_collections.juniper.device.plugins.modules.facts', _modlib_path=modlib_path), File "/usr/lib64/python3.8/runpy.py", line 207, in run_module return _run_module_code(code, init_globals, run_name, mod_spec) File "/usr/lib64/python3.8/runpy.py", line 97, in _run_module_code _run_code(code, mod_globals, init_globals, File "/usr/lib64/python3.8/runpy.py", line 87, in _run_code exec(code, run_globals) File "/tmp/ansible_facts_payload_0easwoi1/ansible_facts_payload.zip/ansible_collections/juniper/device/plugins/modules/facts.py", line 369, in File "/tmp/ansible_facts_payload_0easwoi1/ansible_facts_payload.zip/ansible_collections/juniper/device/plugins/modules/facts.py", line 311, in main File "/tmp/ansible_facts_payload_0easwoi1/ansible_facts_payload.zip/ansible_collections/juniper/device/plugins/module_utils/juniper_junos_common.py", line 611, in init File "/tmp/ansible_facts_payload_0easwoi1/ansible_facts_payload.zip/ansible_collections/juniper/device/plugins/module_utils/juniper_junos_common.py", line 686, in get_connection File "/tmp/ansible_facts_payload_0easwoi1/ansible_facts_payload.zip/ansible_collections/juniper/device/plugins/module_utils/juniper_junos_common.py", line 722, in fail_json File "/tmp/ansible_facts_payload_0easwoi1/ansible_facts_payload.zip/ansible_collections/juniper/device/plugins/module_utils/juniper_junos_common.py", line 1164, in close_configuration AttributeError: 'JuniperJunosModule' object has no attribute '_pyez_conn' fatal: [ptr74-jdm]: FAILED! => { "changed": false, "module_stderr": "Traceback (most recent call last):\n File "/home/ac043s/.ansible/tmp/ansible-local-29214wabu3363/ansible-tmp-1625602138.1041296-29252-272465699950870/AnsiballZ_facts.py", line 100, in \n _ansiballz_main()\n File "/home/ac043s/.ansible/tmp/ansible-local-29214wabu3363/ansible-tmp-1625602138.1041296-29252-272465699950870/AnsiballZ_facts.py", line 92, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File "/home/ac043s/.ansible/tmp/ansible-local-29214wabu3363/ansible-tmp-1625602138.1041296-29252-272465699950870/AnsiballZ_facts.py", line 40, in invoke_module\n runpy.run_module(mod_name='ansible_collections.juniper.device.plugins.modules.facts', init_globals=dict(_module_fqn='ansible_collections.juniper.device.plugins.modules.facts', _modlib_path=modlib_path),\n File "/usr/lib64/python3.8/runpy.py", line 207, in run_module\n return _run_module_code(code, init_globals, run_name, mod_spec)\n File "/usr/lib64/python3.8/runpy.py", line 97, in _run_module_code\n _run_code(code, mod_globals, init_globals,\n File "/usr/lib64/python3.8/runpy.py", line 87, in _run_code\n exec(code, run_globals)\n File "/tmp/ansible_facts_payload_0easwoi1/ansible_facts_payload.zip/ansible_collections/juniper/device/plugins/modules/facts.py", line 369, in \n File "/tmp/ansible_facts_payload_0easwoi1/ansible_facts_payload.zip/ansible_collections/juniper/device/plugins/modules/facts.py", line 311, in main\n File "/tmp/ansible_facts_payload_0easwoi1/ansible_facts_payload.zip/ansible_collections/juniper/device/plugins/module_utils/juniper_junos_common.py", line 611, in init\n File "/tmp/ansible_facts_payload_0easwoi1/ansible_facts_payload.zip/ansible_collections/juniper/device/plugins/module_utils/juniper_junos_common.py", line 686, in get_connection\n File "/tmp/ansible_facts_payload_0easwoi1/ansible_facts_payload.zip/ansible_collections/juniper/device/plugins/module_utils/juniper_junos_common.py", line 722, in fail_json\n File "/tmp/ansible_facts_payload_0easwoi1/ansible_facts_payload.zip/ansible_collections/juniper/device/plugins/module_utils/juniper_junos_common.py", line 1164, in close_configuration\nAttributeError: 'JuniperJunosModule' object has no attribute '_pyez_conn'\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1 }

PLAY RECAP **************************************************************************************************************************************************************************************************** ptr74-jdm : ok=1 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
`

achhabr1 avatar Jul 06 '21 20:07 achhabr1