Skip to content

juniper_junos_facts error in current master #369

@fooelisa

Description

@fooelisa

Issue Type

  • Bug Report

Module Name

juniper_junos_facts

Juniper.Junos role and Python libraries version

Juniper.junos role latest master from github

$ ansible --version
ansible 2.2.3.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides

$ pip freeze
ansible==2.2.3.0
apache-libcloud==2.1.0
asn1crypto==0.24.0
bcrypt==3.1.4
beautifulsoup4==4.4.1
boto==2.38.0
certifi==2018.4.16
cffi==1.11.5
chardet==3.0.4
click==6.7
configobj==5.0.6
crcmod==1.7
cryptography==2.2.2
dnspython==1.12.0
enum34==1.1.6
functools32==3.2.3.post2
gspread==3.0.0
gyp==0.1
html5lib==0.999
httpie==0.9.9
httplib2==0.11.3
idna==2.6
iotop==0.6
ipaddress==1.0.22
Jinja2==2.10
jsonschema==2.6.0
junit-xml==1.7
junos-eznc==2.1.7
jxmlease==1.0.1
lxml==4.2.1
MarkupSafe==1.0
mercurial==3.7.3
ncclient==0.5.3
ndg-httpsclient==0.4.0
netaddr==0.7.19
oauth2client==4.1.2
paramiko==2.4.1
pbr==3.1.1
pexpect==4.2.1
pfpy==0.3
pika==0.11.2
pluggy==0.6.0
prettytable==0.7.2
pssh==2.3.1
psycopg2==2.7.1
ptyprocess==0.5.2
pudb==2017.1.3
py==1.5.2
pyasn1==0.4.2
pyasn1-modules==0.2.1
pycparser==2.18
pycrypto==2.6.1
pycurl==7.43.0
pygelf==0.3.3
Pygments==2.2.0
pygobject==3.20.0
PyNaCl==1.2.1
pyOpenSSL==17.5.0
pyserial==3.4
python-apt==1.1.0b1+ubuntu0.16.4.1
PyYAML==3.12
redis==2.10.6
redis-py-cluster==1.3.4
requests==2.18.4
rsa==3.4.2
scp==0.11.0
six==1.11.0
stevedore==1.25.0
tox==2.9.1
urllib3==1.22
urwid==1.3.1
virtualenv==15.1.0
virtualenv-clone==0.2.6
virtualenvwrapper==4.7.2
xmltodict==0.11.0

OS / Environment

Experiencing the issue on various platforms and versions, eg. QFX10002, QFX10008, EX4300, EXEX4600, MX104, etc.

Summary

Get facts produces an error on the current master branch, but works fine in 2.0.2

Steps to reproduce

- name: get junos facts from hosts
  juniper_junos_facts:
    host={{ device_name }}
    user={{ user }}
    passwd={{ passwd }}
    port={{ netconf_port }}
  register: junos

Expected results

No error

Actual results

$ ansible-playbook -i dev show_facts.yml --limit cfr1.lab2 -vvvv
Using /etc/ansible/ansible.cfg as config file
Loading callback plugin default of type stdout, v2.0 from /usr/local/lib/python2.7/dist-packages/ansible/plugins/callback/__init__.pyc
Loading callback plugin jsnapy of type aggregate, v2.0 from /usr/local/lib/python2.7/dist-packages/ansible/plugins/callback/__init__.pyc

PLAYBOOK: show_facts.yml **************************************************
1 plays in show_facts.yml

PLAY [Show Junos Facts] ********************************************************

TASK [get-facts : get junos facts from hosts] **********************************
task path: /opt/viki/ansible/roles/get-facts/tasks/main.yml:3
An exception occurred during task execution. The full traceback is:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/ansible/executor/task_executor.py", line 126, in run
    res = self._execute()
  File "/usr/local/lib/python2.7/dist-packages/ansible/executor/task_executor.py", line 511, in _execute
    result = self._handler.run(task_vars=variables)
  File "/opt/ansible-junos-stdlib/Juniper.junos/module_utils/juniper_junos_common.py", line 1948, in run
    return super(JuniperJunosActionModule, self).run(tmp, task_vars)
  File "/usr/local/lib/python2.7/dist-packages/ansible/plugins/action/normal.py", line 33, in run
    results = merge_hash(results, self._execute_module(tmp=tmp, task_vars=task_vars))
  File "/usr/local/lib/python2.7/dist-packages/ansible/plugins/action/__init__.py", line 575, in _execute_module
    (module_style, shebang, module_data, module_path) = self._configure_module(module_name=module_name, module_args=module_args, task_vars=task_vars)
  File "/usr/local/lib/python2.7/dist-packages/ansible/plugins/action/__init__.py", line 153, in _configure_module
    task_vars=task_vars, module_compression=self._play_context.module_compression)
  File "/usr/local/lib/python2.7/dist-packages/ansible/executor/module_common.py", line 796, in modify_module
    (module_data, module_style, shebang) = _find_snippet_imports(module_name, module_data, module_path, module_args, task_vars, module_compression)
  File "/usr/local/lib/python2.7/dist-packages/ansible/executor/module_common.py", line 657, in _find_snippet_imports
    recursive_finder(module_name, module_data, py_module_names, py_module_cache, zf)
  File "/usr/local/lib/python2.7/dist-packages/ansible/executor/module_common.py", line 497, in recursive_finder
    msg.append('either %s or %s' % (py_module_name[-1], py_module_name[-2]))
IndexError: tuple index out of range

fatal: [cfr1.lab2]: FAILED! => {
    "failed": true,
    "msg": "Unexpected failure during module execution.",
    "stdout": ""
}

PLAY RECAP *********************************************************************
cfr1.lab2                  : ok=0    changed=0    unreachable=0    failed=1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions