You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary
Run module juniper_junos_snappy with telnet mode is error
Steps to reproduce
ansible-playbook -i inventories/ACX_test.yml check_log.yml -vvv
(please ignore the inventory file, i added static device's information into module)
Expected results
The Jsnappy should work as Netconf mode
Actual results
The playbook throws back error:
'Uncaught exception - please report: stat: path should be string, bytes, os.PathLike or integer, not dict' (please see below)
ansible-playbook 2.8.0config file = /opt/SVTECH-Junos-Automation/Ansible-Development/ansible.cfgconfigured module search path = ['/opt/SVTECH-Junos-Automation/Ansible-Development/library']ansible python module location = /opt/.pyenv/versions/3.6.5/envs/automation36/lib/python3.6/site-packages/ansibleexecutable location = /opt/.pyenv/versions/automation36/bin/ansible-playbookpython version = 3.6.5 (default, Oct 8 2020, 10:56:49) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]Using /opt/SVTECH-Junos-Automation/Ansible-Development/ansible.cfg as config filesetting up inventory pluginshost_list declined parsing /opt/SVTECH-Junos-Automation/Ansible-Development/inventories/ACX_test.yml as it did not pass it's verify_file() methodscript declined parsing /opt/SVTECH-Junos-Automation/Ansible-Development/inventories/ACX_test.yml as it did not pass it's verify_file() methodParsed /opt/SVTECH-Junos-Automation/Ansible-Development/inventories/ACX_test.yml inventory source with ini pluginLoading callback plugin default of type stdout, v2.0 from /opt/SVTECH-Junos-Automation/Ansible-Development/callback/rundeck.pyLoading callback plugin timer of type aggregate, v2.0 from /opt/.pyenv/versions/3.6.5/envs/automation36/lib/python3.6/site-packages/ansible/plugins/callback/timer.pyPLAYBOOK: check_log.yml *******************************************************************************************************************************************************************************[WARNING]: Failure using method (v2_playbook_on_start) in callback plugin (<ansible.plugins.callback.rundeck.CallbackModule object at 0x7f61ea81e4e0>): 'CallbackModule' object has no attribute'_options'Callback Exception:
File "/opt/.pyenv/versions/3.6.5/envs/automation36/lib/python3.6/site-packages/ansible/executor/task_queue_manager.py", line 333, in send_callbackmethod(*new_args, **kwargs)File "/opt/SVTECH-Junos-Automation/Ansible-Development/callback/rundeck.py", line 315, in v2_playbook_on_startif self._options is not None:
1 plays in check_log.ymlPLAY [Gather ge-0/0/0 interface information] **********************************************************************************************************************************************************META: ran handlersTASK [[SNAPSHOT VERSION - STEP 03] - Checking Snapshot version] ***************************************************************************************************************************************task path: /opt/SVTECH-Junos-Automation/Ansible-Development/check_log.yml:14Using module file /opt/SVTECH-Junos-Automation/Ansible-Development/roles/Juniper.junos/library/juniper_junos_jsnapy.pyPipelining is enabled.<10.96.10.1> ESTABLISH LOCAL CONNECTION FOR USER: root<10.96.10.1> EXEC /bin/sh -c '/opt/.pyenv/versions/3.6.5/envs/automation36/bin/python && sleep 0'The full traceback is:
File "/tmp/ansible_juniper_junos_jsnapy_payload_svae2i2t/__main__.py", line 298, in maindev=junos_module.dev)File "/opt/.pyenv/versions/3.6.5/envs/automation36/lib/python3.6/site-packages/jnpr/jsnapy/jsnapy.py", line 1011, in snapcheckres = self.extract_data(data, file_name, "snapcheck", local=local)File "/opt/.pyenv/versions/3.6.5/envs/automation36/lib/python3.6/site-packages/jnpr/jsnapy/jsnapy.py", line 835, in extract_dataif os.path.isfile(config_data):
File "/opt/.pyenv/versions/3.6.5/lib/python3.6/genericpath.py", line 30, in isfilest = os.stat(path)fatal: [ACX2100]: FAILED! => {"changed": false,"invocation": {"module_args": {"action": "snapcheck","attempts": 10,"baud": 9600,"config_file": null,"console": null,"cs_passwd": null,"cs_user": null,"dir": "/etc/jsnapy/testfiles","host": "10.96.10.1","level": null,"logdir": null,"logfile": null,"mode": "telnet","passwd": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER","port": 23,"ssh_config": null,"ssh_private_key_file": null,"test_files": ["/opt/SVTECH-Junos-Automation/Ansible-Development/roles/acx_check_snapshot_version/tmp/10.96.10.1_snapcheck_snapshot_version.yml"],"timeout": 3600,"user": "juniper"}},"msg": "Uncaught exception - please report: stat: path should be string, bytes, os.PathLike or integer, not dict"}PLAY RECAP ********************************************************************************************************************************************************************************************ACX2100 : ok=0 changed=0 unreachable=0 failed=1 LIST HOST STATE FOR RUNDECK ***************************************************************************************************************************************************************************RUNDECK:DATA:HOSTS_OK=""RUNDECK:DATA:HOSTS_ERROR="ACX2100"RUNDECK:DATA:HOSTS_IGNORED_ERROR=""
Our case study:
We'd like to write a playbook that auto generate credential (using telnet mode or netconf mode) base on specific conditions:
Port 22/830 is open => generate credential with netconf mode
Port 22/830 is disable, 23 is open => generate credential with telnet mode
The text was updated successfully, but these errors were encountered:
Hi @tuhoanganh
Thanks ,
we are seeing different issue with mode=telnet and port=23 ,
Could you please replicate this issue with latest ansible collection and update .
ansible-playbook issue_535_jsnapy.yml
PLAY [Test juniper.device.jsnapy module] **********************************************************************************************************************************
TASK [TEST 1 - Execute SNAPCHECK with 1 test file / no dir] ***************************************************************************************************************
fatal: [local_connection_testcases]: FAILED! => {"changed": false, "msg": "Uncaught exception - please report: not all arguments converted during string formatting"}
...ignoring
TASK [debug] **************************************************************************************************************************************************************
ok: [local_connection_testcases] => {
"test1": {
"changed": false,
"failed": true,
"msg": "Uncaught exception - please report: not all arguments converted during string formatting"
}
}
TASK [Check TEST 1] *******************************************************************************************************************************************************
fatal: [local_connection_testcases]: FAILED! => {"msg": "The conditional check 'test1.total_passed == 1' failed. The error was: error while evaluating conditional (test1.total_passed == 1): 'dict object' has no attribute 'total_passed'. 'dict object' has no attribute 'total_passed'"}
PLAY RECAP ****************************************************************************************************************************************************************
local_connection_testcases : ok=2 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=1
Issue Type
Module Name
juniper_junos_jsnapy
juniper.device collection and Python libraries version
OS / Environment
Ansible Server: Centos 7 minmal 1908
Devices:JUNOS 15.1X54-D37.9 - ACX1000, ACX2100
Summary
Run module juniper_junos_snappy with telnet mode is error
Steps to reproduce
ansible-playbook -i inventories/ACX_test.yml check_log.yml -vvv
(please ignore the inventory file, i added static device's information into module)
Expected results
The Jsnappy should work as Netconf mode
Actual results
The playbook throws back error:
'Uncaught exception - please report: stat: path should be string, bytes, os.PathLike or integer, not dict' (please see below)
Our case study:
We'd like to write a playbook that auto generate credential (using telnet mode or netconf mode) base on specific conditions:
netconf
modetelnet
modeThe text was updated successfully, but these errors were encountered: