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

Fixes 374 - Adds example of Other/unknown media on LLDP for a device … #377

Merged
merged 3 commits into from
Jul 19, 2019
Merged

Conversation

jvanderaa
Copy link
Contributor

…to the raw, and a proposed fix

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT

cisco_ios_show_lldp_neighbors_detail

SUMMARY

The change removed a search string that was looking for (text)within the media type. This would not match on:

Physical media capabilities:
    Other/unknown

Changes ^\s+.+\(\S+\)\s*$$ to ^\s+.+\s*$$ and added comments.

Before

PLAY [Verify TextFSM template] *********************************************************************************************************************************************************************************

TASK [cisco_ios_show_lldp_neighbors_detail: run TextFSM on test input] *****************************************************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: textfsm.TextFSMError: State Error raised. Rule Line: 49. Input Line:     Other/unknown
failed: [localhost] (item=/Users/jvanderaa/Github/ntc-templates/tests/cisco_ios/show_lldp_neighbors_detail/cisco_ios_show_lldp_neighbors_detail4.raw) => {"changed": false, "item": "/Users/jvanderaa/Github/ntc-templates/tests/cisco_ios/show_lldp_neighbors_detail/cisco_ios_show_lldp_neighbors_detail4.raw", "module_stderr": "Traceback (most recent call last):\n  File \"/Users/jvanderaa/.ansible/tmp/ansible-tmp-1551112071.85-114973716454281/AnsiballZ_ntc_show_command.py\", line 113, in <module>\n    _ansiballz_main()\n  File \"/Users/jvanderaa/.ansible/tmp/ansible-tmp-1551112071.85-114973716454281/AnsiballZ_ntc_show_command.py\", line 105, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/Users/jvanderaa/.ansible/tmp/ansible-tmp-1551112071.85-114973716454281/AnsiballZ_ntc_show_command.py\", line 48, in invoke_module\n    imp.load_module('__main__', mod, module, MOD_DESC)\n  File \"/var/folders/dq/_tjy3jfn0j98n6j590nyr24jpxb_7r/T/ansible_ntc_show_command_payload_7jI3Lh/__main__.py\", line 511, in <module>\n  File \"/var/folders/dq/_tjy3jfn0j98n6j590nyr24jpxb_7r/T/ansible_ntc_show_command_payload_7jI3Lh/__main__.py\", line 498, in main\n  File \"/var/folders/dq/_tjy3jfn0j98n6j590nyr24jpxb_7r/T/ansible_ntc_show_command_payload_7jI3Lh/__main__.py\", line 316, in parse_raw_output\n  File \"/var/folders/dq/_tjy3jfn0j98n6j590nyr24jpxb_7r/T/ansible_ntc_show_command_payload_7jI3Lh/__main__.py\", line 292, in get_structured_data\n  File \"/Library/Python/2.7/site-packages/clitable.py\", line 277, in ParseCmd\n    self.table = self._ParseCmdItem(self.raw, template_file=template_files[0])\n  File \"/Library/Python/2.7/site-packages/clitable.py\", line 310, in _ParseCmdItem\n    for record in fsm.ParseText(cmd_input):\n  File \"/Library/Python/2.7/site-packages/textfsm.py\", line 885, in ParseText\n    self._CheckLine(line)\n  File \"/Library/Python/2.7/site-packages/textfsm.py\", line 908, in _CheckLine\n    if self._Operations(rule, line):\n  File \"/Library/Python/2.7/site-packages/textfsm.py\", line 989, in _Operations\n    % (rule.line_num, line))\ntextfsm.TextFSMError: State Error raised. Rule Line: 49. Input Line:     Other/unknown\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}
ok: [localhost] => (item=/Users/jvanderaa/Github/ntc-templates/tests/cisco_ios/show_lldp_neighbors_detail/cisco_ios_show_lldp_neighbors_detail1.raw)
ok: [localhost] => (item=/Users/jvanderaa/Github/ntc-templates/tests/cisco_ios/show_lldp_neighbors_detail/cisco_ios_show_lldp_neighbors_detail2.raw)
ok: [localhost] => (item=/Users/jvanderaa/Github/ntc-templates/tests/cisco_ios/show_lldp_neighbors_detail/cisco_ios_show_lldp_neighbors_detail3.raw)
	to retry, use: --limit @/Users/jvanderaa/Github/ntc-templates/test-template.retry

PLAY RECAP *****************************************************************************************************************************************************************************************************
localhost                  : ok=0    changed=0    unreachable=0    failed=1

After

PLAY [Verify TextFSM template] *********************************************************************************************************************************************************************************

TASK [cisco_ios_show_lldp_neighbors_detail: run TextFSM on test input] *****************************************************************************************************************************************
ok: [localhost] => (item=/Users/jvanderaa/Github/ntc-templates/tests/cisco_ios/show_lldp_neighbors_detail/cisco_ios_show_lldp_neighbors_detail4.raw)
ok: [localhost] => (item=/Users/jvanderaa/Github/ntc-templates/tests/cisco_ios/show_lldp_neighbors_detail/cisco_ios_show_lldp_neighbors_detail1.raw)
ok: [localhost] => (item=/Users/jvanderaa/Github/ntc-templates/tests/cisco_ios/show_lldp_neighbors_detail/cisco_ios_show_lldp_neighbors_detail2.raw)
ok: [localhost] => (item=/Users/jvanderaa/Github/ntc-templates/tests/cisco_ios/show_lldp_neighbors_detail/cisco_ios_show_lldp_neighbors_detail3.raw)

TASK [cisco_ios_show_lldp_neighbors_detail: read parsed sample files] ******************************************************************************************************************************************
ok: [localhost] => (item={'_ansible_parsed': True, '_ansible_item_result': True, '_ansible_no_log': False, 'failed': False, 'changed': False, 'item': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_ios/show_lldp_neighbors_detail/cisco_ios_show_lldp_neighbors_detail4.raw', '_ansible_item_label': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_ios/show_lldp_neighbors_detail/cisco_ios_show_lldp_neighbors_detail4.raw', u'invocation': {u'module_args': {u'username': None, u'local_file': None, u'use_keys': False, u'host': None, u'file': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_ios/show_lldp_neighbors_detail/cisco_ios_show_lldp_neighbors_detail4.raw', u'global_delay_factor': u'1', u'password': None, u'port': None, u'index_file': u'index', u'delay': u'1', u'trigger_device_list': None, u'template_dir': u'/Users/jvanderaa/Github/ntc-templates/templates', u'connection_args': {}, u'connection': u'offline', u'use_templates': True, u'platform': u'cisco_ios', u'secret': None, u'command': u'show lldp neighbors detail', u'optional_args': {}, u'provider': None, u'key_file': None}}, u'response': [{u'system_description': u'ZULTYS IP Phone', u'neighbor_interface': u'WAN PORT', u'local_interface': u'Gi2/0/13', u'vlan': u'', u'chassis_id': u'172.16.4.125', u'neighbor_port_id': u'000b.ea00.16e0', u'management_ip': u'', u'capabilities': u'T', u'neighbor': u'ZULTYS IP Phone'}, {u'system_description': u'Cisco IOS Software, s6t64 Software (s6t64-ADVENTERPRISEK9-M), Version 15.4(1)SY3, RELEASE SOFTWARE (fc4)', u'neighbor_interface': u'asw22 ', u'local_interface': u'Te1/1/1', u'vlan': u'1', u'chassis_id': u'2c33.1100.a6c0', u'neighbor_port_id': u'Te1/2/13', u'management_ip': u'172.16.0.10', u'capabilities': u'B,R', u'neighbor': u'dsw01'}], '_ansible_ignore_errors': None, u'response_list': []})
ok: [localhost] => (item={'_ansible_parsed': True, '_ansible_item_result': True, '_ansible_no_log': False, 'failed': False, 'changed': False, 'item': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_ios/show_lldp_neighbors_detail/cisco_ios_show_lldp_neighbors_detail1.raw', '_ansible_item_label': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_ios/show_lldp_neighbors_detail/cisco_ios_show_lldp_neighbors_detail1.raw', u'invocation': {u'module_args': {u'username': None, u'local_file': None, u'use_keys': False, u'host': None, u'file': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_ios/show_lldp_neighbors_detail/cisco_ios_show_lldp_neighbors_detail1.raw', u'global_delay_factor': u'1', u'password': None, u'port': None, u'index_file': u'index', u'delay': u'1', u'trigger_device_list': None, u'template_dir': u'/Users/jvanderaa/Github/ntc-templates/templates', u'connection_args': {}, u'connection': u'offline', u'use_templates': True, u'platform': u'cisco_ios', u'secret': None, u'command': u'show lldp neighbors detail', u'optional_args': {}, u'provider': None, u'key_file': None}}, u'response': [{u'system_description': u'Juniper Networks, Inc. ex2200-24t-4g , version 12.3R9.4 Build date: 2015-02-12 11:25:30 UTC', u'neighbor_interface': u'ge-0/0/0.0', u'local_interface': u'Gi1/0/2', u'vlan': u'1', u'chassis_id': u'7c25.86c9.aaaa', u'neighbor_port_id': u'502', u'management_ip': u'', u'capabilities': u'B,R', u'neighbor': u''}, {u'system_description': u'HPE OfficeConnect Switch 1820 48G J9981A, PT.02.01, Linux 3.6.5-79c95a77, U-Boot 2012.10-00116-g3ab515c (Jul 30 2014 - 10:52:01)', u'neighbor_interface': u'13', u'local_interface': u'Gi1/0/1', u'vlan': u'', u'chassis_id': u'94f1.2879.5555', u'neighbor_port_id': u'94f1.2879.5555', u'management_ip': u'192.168.1.81', u'capabilities': u'B', u'neighbor': u'HpSwitch'}, {u'system_description': u'ArubaOS (MODEL: 225), Version 6.4.2.6-4.1.1.6 (50009)', u'neighbor_interface': u'eth0', u'local_interface': u'Gi1/0/9', u'vlan': u'', u'chassis_id': u'4448.c1c4.dddd', u'neighbor_port_id': u'4448.c1c4.dddd', u'management_ip': u'192.168.1.40', u'capabilities': u'W', u'neighbor': u'44:48:c1:c4:dd:dd'}], '_ansible_ignore_errors': None, u'response_list': []})
ok: [localhost] => (item={'_ansible_parsed': True, '_ansible_item_result': True, '_ansible_no_log': False, 'failed': False, 'changed': False, 'item': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_ios/show_lldp_neighbors_detail/cisco_ios_show_lldp_neighbors_detail2.raw', '_ansible_item_label': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_ios/show_lldp_neighbors_detail/cisco_ios_show_lldp_neighbors_detail2.raw', u'invocation': {u'module_args': {u'username': None, u'local_file': None, u'use_keys': False, u'host': None, u'file': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_ios/show_lldp_neighbors_detail/cisco_ios_show_lldp_neighbors_detail2.raw', u'global_delay_factor': u'1', u'password': None, u'port': None, u'index_file': u'index', u'delay': u'1', u'trigger_device_list': None, u'template_dir': u'/Users/jvanderaa/Github/ntc-templates/templates', u'connection_args': {}, u'connection': u'offline', u'use_templates': True, u'platform': u'cisco_ios', u'secret': None, u'command': u'show lldp neighbors detail', u'optional_args': {}, u'provider': None, u'key_file': None}}, u'response': [{u'system_description': u'Cisco NX-OS(tm) n7700, Software (n7700-s2-dk9), Version 6.2(10), RELEASE SOFTWARE Copyright (c) 2002-2013 by Cisco Systems, Inc. Compiled 10/9/2014 12:00:00', u'neighbor_interface': u'PO2631-10Gx2-R261R5', u'local_interface': u'', u'vlan': u'1', u'chassis_id': u'a000.f00e.300d', u'neighbor_port_id': u'Eth1/6', u'management_ip': u'11.11.11.11', u'capabilities': u'B,R', u'neighbor': u'USSC-CAMPUS-CORE-GW2'}, {u'system_description': u'Cisco NX-OS(tm) n7700, Software (n7700-s2-dk9), Version 6.2(10), RELEASE SOFTWARE Copyright (c) 2002-2013 by Cisco Systems, Inc. Compiled 10/9/2014 12:00:00', u'neighbor_interface': u'PO2631-10Gx2-R261R5', u'local_interface': u'', u'vlan': u'1', u'chassis_id': u'2222.0642.7333', u'neighbor_port_id': u'Eth1/6', u'management_ip': u'33.33.33.3', u'capabilities': u'B,R', u'neighbor': u'USSC-CAMPUS-CORE-GW1.acme123.com'}, {u'system_description': u'Cisco IOS Software, C3750 Software (C3750-IPSERVICESK9-M), Version 12.2(53)SE2, RELEASE SOFTWARE (fc3)', u'neighbor_interface': u'GigabitEthernet2/0/24', u'local_interface': u'', u'vlan': u'', u'chassis_id': u'0015.2222.c330', u'neighbor_port_id': u'Gi2/0/24', u'management_ip': u'55.55.55.55', u'capabilities': u'B', u'neighbor': u'DMZ-SW1'}, {u'system_description': u'', u'neighbor_interface': u'', u'local_interface': u'', u'vlan': u'', u'chassis_id': u'0022.1111.2222', u'neighbor_port_id': u'g2', u'management_ip': u'', u'capabilities': u'', u'neighbor': u''}], '_ansible_ignore_errors': None, u'response_list': []})
ok: [localhost] => (item={'_ansible_parsed': True, '_ansible_item_result': True, '_ansible_no_log': False, 'failed': False, 'changed': False, 'item': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_ios/show_lldp_neighbors_detail/cisco_ios_show_lldp_neighbors_detail3.raw', '_ansible_item_label': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_ios/show_lldp_neighbors_detail/cisco_ios_show_lldp_neighbors_detail3.raw', u'invocation': {u'module_args': {u'username': None, u'local_file': None, u'use_keys': False, u'host': None, u'file': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_ios/show_lldp_neighbors_detail/cisco_ios_show_lldp_neighbors_detail3.raw', u'global_delay_factor': u'1', u'password': None, u'port': None, u'index_file': u'index', u'delay': u'1', u'trigger_device_list': None, u'template_dir': u'/Users/jvanderaa/Github/ntc-templates/templates', u'connection_args': {}, u'connection': u'offline', u'use_templates': True, u'platform': u'cisco_ios', u'secret': None, u'command': u'show lldp neighbors detail', u'optional_args': {}, u'provider': None, u'key_file': None}}, u'response': [{u'system_description': u'Cisco IP Phone 7962G,V12, SCCP42.9-3-1ES27S', u'neighbor_interface': u'SW PORT', u'local_interface': u'Gi0/1/7', u'vlan': u'', u'chassis_id': u'10.10.0.1', u'neighbor_port_id': u'C8F9F9D61BC2:P1', u'management_ip': u'10.10.0.1', u'capabilities': u'B,T', u'neighbor': u'SEPC8F9F9D61BC2'}], '_ansible_ignore_errors': None, u'response_list': []})

TASK [cisco_ios_show_lldp_neighbors_detail: verify that parsed result is the same as expected] *****************************************************************************************************************
ok: [localhost] => (item={'_ansible_item_result': True, '_ansible_no_log': False, 'failed': False, 'changed': False, 'item': {'_ansible_parsed': True, '_ansible_item_result': True, '_ansible_no_log': False, 'item': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_ios/show_lldp_neighbors_detail/cisco_ios_show_lldp_neighbors_detail4.raw', 'changed': False, 'failed': False, '_ansible_item_label': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_ios/show_lldp_neighbors_detail/cisco_ios_show_lldp_neighbors_detail4.raw', u'invocation': {u'module_args': {u'username': None, u'local_file': None, u'use_keys': False, u'host': None, u'file': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_ios/show_lldp_neighbors_detail/cisco_ios_show_lldp_neighbors_detail4.raw', u'global_delay_factor': u'1', u'password': None, u'port': None, u'index_file': u'index', u'use_templates': True, u'trigger_device_list': None, u'template_dir': u'/Users/jvanderaa/Github/ntc-templates/templates', u'connection_args': {}, u'secret': None, u'delay': u'1', u'platform': u'cisco_ios', u'connection': u'offline', u'command': u'show lldp neighbors detail', u'optional_args': {}, u'provider': None, u'key_file': None}}, u'response': [{u'system_description': u'ZULTYS IP Phone', u'neighbor_interface': u'WAN PORT', u'local_interface': u'Gi2/0/13', u'vlan': u'', u'capabilities': u'T', u'neighbor_port_id': u'000b.ea00.16e0', u'management_ip': u'', u'chassis_id': u'172.16.4.125', u'neighbor': u'ZULTYS IP Phone'}, {u'system_description': u'Cisco IOS Software, s6t64 Software (s6t64-ADVENTERPRISEK9-M), Version 15.4(1)SY3, RELEASE SOFTWARE (fc4)', u'neighbor_interface': u'asw22 ', u'local_interface': u'Te1/1/1', u'vlan': u'1', u'capabilities': u'B,R', u'neighbor_port_id': u'Te1/2/13', u'management_ip': u'172.16.0.10', u'chassis_id': u'2c33.1100.a6c0', u'neighbor': u'dsw01'}], '_ansible_ignore_errors': None, u'response_list': []}, 'ansible_included_var_files': [u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_ios/show_lldp_neighbors_detail/cisco_ios_show_lldp_neighbors_detail4.parsed'], 'ansible_facts': {u'parsed_sample': [{u'system_description': u'ZULTYS IP Phone', u'neighbor_interface': u'WAN PORT', u'local_interface': u'Gi2/0/13', u'vlan': u'', u'chassis_id': u'172.16.4.125', u'neighbor_port_id': u'000b.ea00.16e0', u'management_ip': u'', u'capabilities': u'T', u'neighbor': u'ZULTYS IP Phone'}, {u'system_description': u'Cisco IOS Software, s6t64 Software (s6t64-ADVENTERPRISEK9-M), Version 15.4(1)SY3, RELEASE SOFTWARE (fc4)', u'neighbor_interface': u'asw22', u'local_interface': u'Te1/1/1', u'vlan': u'', u'chassis_id': u'2c33.1100.a6c0', u'neighbor_port_id': u'Te1/2/13', u'management_ip': u'172.16.0.10', u'capabilities': u'B,R', u'neighbor': u'dsw01'}]}, '_ansible_ignore_errors': None, '_ansible_item_label': {'_ansible_parsed': True, '_ansible_item_result': True, '_ansible_no_log': False, 'item': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_ios/show_lldp_neighbors_detail/cisco_ios_show_lldp_neighbors_detail4.raw', 'changed': False, 'failed': False, '_ansible_item_label': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_ios/show_lldp_neighbors_detail/cisco_ios_show_lldp_neighbors_detail4.raw', u'invocation': {u'module_args': {u'username': None, u'local_file': None, u'use_keys': False, u'host': None, u'file': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_ios/show_lldp_neighbors_detail/cisco_ios_show_lldp_neighbors_detail4.raw', u'global_delay_factor': u'1', u'password': None, u'port': None, u'index_file': u'index', u'use_templates': True, u'trigger_device_list': None, u'template_dir': u'/Users/jvanderaa/Github/ntc-templates/templates', u'connection_args': {}, u'secret': None, u'delay': u'1', u'platform': u'cisco_ios', u'connection': u'offline', u'command': u'show lldp neighbors detail', u'optional_args': {}, u'provider': None, u'key_file': None}}, u'response': [{u'system_description': u'ZULTYS IP Phone', u'neighbor_interface': u'WAN PORT', u'local_interface': u'Gi2/0/13', u'vlan': u'', u'chassis_id': u'172.16.4.125', u'neighbor_port_id': u'000b.ea00.16e0', u'management_ip': u'', u'capabilities': u'T', u'neighbor': u'ZULTYS IP Phone'}, {u'system_description': u'Cisco IOS Software, s6t64 Software (s6t64-ADVENTERPRISEK9-M), Version 15.4(1)SY3, RELEASE SOFTWARE (fc4)', u'neighbor_interface': u'asw22 ', u'local_interface': u'Te1/1/1', u'vlan': u'1', u'chassis_id': u'2c33.1100.a6c0', u'neighbor_port_id': u'Te1/2/13', u'management_ip': u'172.16.0.10', u'capabilities': u'B,R', u'neighbor': u'dsw01'}], '_ansible_ignore_errors': None, u'response_list': []}})
ok: [localhost] => (item={'_ansible_item_result': True, '_ansible_no_log': False, 'failed': False, 'changed': False, 'item': {'_ansible_parsed': True, '_ansible_item_result': True, '_ansible_no_log': False, 'item': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_ios/show_lldp_neighbors_detail/cisco_ios_show_lldp_neighbors_detail1.raw', 'changed': False, 'failed': False, '_ansible_item_label': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_ios/show_lldp_neighbors_detail/cisco_ios_show_lldp_neighbors_detail1.raw', u'invocation': {u'module_args': {u'username': None, u'local_file': None, u'use_keys': False, u'host': None, u'file': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_ios/show_lldp_neighbors_detail/cisco_ios_show_lldp_neighbors_detail1.raw', u'global_delay_factor': u'1', u'password': None, u'port': None, u'index_file': u'index', u'use_templates': True, u'trigger_device_list': None, u'template_dir': u'/Users/jvanderaa/Github/ntc-templates/templates', u'connection_args': {}, u'secret': None, u'delay': u'1', u'platform': u'cisco_ios', u'connection': u'offline', u'command': u'show lldp neighbors detail', u'optional_args': {}, u'provider': None, u'key_file': None}}, u'response': [{u'system_description': u'Juniper Networks, Inc. ex2200-24t-4g , version 12.3R9.4 Build date: 2015-02-12 11:25:30 UTC', u'neighbor_interface': u'ge-0/0/0.0', u'local_interface': u'Gi1/0/2', u'vlan': u'1', u'capabilities': u'B,R', u'neighbor_port_id': u'502', u'management_ip': u'', u'chassis_id': u'7c25.86c9.aaaa', u'neighbor': u''}, {u'system_description': u'HPE OfficeConnect Switch 1820 48G J9981A, PT.02.01, Linux 3.6.5-79c95a77, U-Boot 2012.10-00116-g3ab515c (Jul 30 2014 - 10:52:01)', u'neighbor_interface': u'13', u'local_interface': u'Gi1/0/1', u'vlan': u'', u'capabilities': u'B', u'neighbor_port_id': u'94f1.2879.5555', u'management_ip': u'192.168.1.81', u'chassis_id': u'94f1.2879.5555', u'neighbor': u'HpSwitch'}, {u'system_description': u'ArubaOS (MODEL: 225), Version 6.4.2.6-4.1.1.6 (50009)', u'neighbor_interface': u'eth0', u'local_interface': u'Gi1/0/9', u'vlan': u'', u'capabilities': u'W', u'neighbor_port_id': u'4448.c1c4.dddd', u'management_ip': u'192.168.1.40', u'chassis_id': u'4448.c1c4.dddd', u'neighbor': u'44:48:c1:c4:dd:dd'}], '_ansible_ignore_errors': None, u'response_list': []}, 'ansible_included_var_files': [u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_ios/show_lldp_neighbors_detail/cisco_ios_show_lldp_neighbors_detail1.parsed'], 'ansible_facts': {u'parsed_sample': [{u'system_description': u'Juniper Networks, Inc. ex2200-24t-4g , version 12.3R9.4 Build date: 2015-02-12 11:25:30 UTC', u'neighbor_interface': u'ge-0/0/0.0', u'local_interface': u'Gi1/0/2', u'vlan': u'1', u'chassis_id': u'7c25.86c9.aaaa', u'neighbor_port_id': u'502', u'management_ip': u'', u'capabilities': u'B,R', u'neighbor': u''}, {u'system_description': u'HPE OfficeConnect Switch 1820 48G J9981A, PT.02.01, Linux 3.6.5-79c95a77, U-Boot 2012.10-00116-g3ab515c (Jul 30 2014 - 10:52:01)', u'neighbor_interface': u'13', u'local_interface': u'Gi1/0/1', u'vlan': u'', u'chassis_id': u'94f1.2879.5555', u'neighbor_port_id': u'94f1.2879.5555', u'management_ip': u'192.168.1.81', u'capabilities': u'B', u'neighbor': u'HpSwitch'}, {u'system_description': u'ArubaOS (MODEL: 225), Version 6.4.2.6-4.1.1.6 (50009)', u'neighbor_interface': u'eth0', u'local_interface': u'Gi1/0/9', u'vlan': u'', u'chassis_id': u'4448.c1c4.dddd', u'neighbor_port_id': u'4448.c1c4.dddd', u'management_ip': u'192.168.1.40', u'capabilities': u'W', u'neighbor': u'44:48:c1:c4:dd:dd'}]}, '_ansible_ignore_errors': None, '_ansible_item_label': {'_ansible_parsed': True, '_ansible_item_result': True, '_ansible_no_log': False, 'item': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_ios/show_lldp_neighbors_detail/cisco_ios_show_lldp_neighbors_detail1.raw', 'changed': False, 'failed': False, '_ansible_item_label': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_ios/show_lldp_neighbors_detail/cisco_ios_show_lldp_neighbors_detail1.raw', u'invocation': {u'module_args': {u'username': None, u'local_file': None, u'use_keys': False, u'host': None, u'file': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_ios/show_lldp_neighbors_detail/cisco_ios_show_lldp_neighbors_detail1.raw', u'global_delay_factor': u'1', u'password': None, u'port': None, u'index_file': u'index', u'use_templates': True, u'trigger_device_list': None, u'template_dir': u'/Users/jvanderaa/Github/ntc-templates/templates', u'connection_args': {}, u'secret': None, u'delay': u'1', u'platform': u'cisco_ios', u'connection': u'offline', u'command': u'show lldp neighbors detail', u'optional_args': {}, u'provider': None, u'key_file': None}}, u'response': [{u'system_description': u'Juniper Networks, Inc. ex2200-24t-4g , version 12.3R9.4 Build date: 2015-02-12 11:25:30 UTC', u'neighbor_interface': u'ge-0/0/0.0', u'local_interface': u'Gi1/0/2', u'vlan': u'1', u'chassis_id': u'7c25.86c9.aaaa', u'neighbor_port_id': u'502', u'management_ip': u'', u'capabilities': u'B,R', u'neighbor': u''}, {u'system_description': u'HPE OfficeConnect Switch 1820 48G J9981A, PT.02.01, Linux 3.6.5-79c95a77, U-Boot 2012.10-00116-g3ab515c (Jul 30 2014 - 10:52:01)', u'neighbor_interface': u'13', u'local_interface': u'Gi1/0/1', u'vlan': u'', u'chassis_id': u'94f1.2879.5555', u'neighbor_port_id': u'94f1.2879.5555', u'management_ip': u'192.168.1.81', u'capabilities': u'B', u'neighbor': u'HpSwitch'}, {u'system_description': u'ArubaOS (MODEL: 225), Version 6.4.2.6-4.1.1.6 (50009)', u'neighbor_interface': u'eth0', u'local_interface': u'Gi1/0/9', u'vlan': u'', u'chassis_id': u'4448.c1c4.dddd', u'neighbor_port_id': u'4448.c1c4.dddd', u'management_ip': u'192.168.1.40', u'capabilities': u'W', u'neighbor': u'44:48:c1:c4:dd:dd'}], '_ansible_ignore_errors': None, u'response_list': []}})
ok: [localhost] => (item={'_ansible_item_result': True, '_ansible_no_log': False, 'failed': False, 'changed': False, 'item': {'_ansible_parsed': True, '_ansible_item_result': True, '_ansible_no_log': False, 'item': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_ios/show_lldp_neighbors_detail/cisco_ios_show_lldp_neighbors_detail2.raw', 'changed': False, 'failed': False, '_ansible_item_label': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_ios/show_lldp_neighbors_detail/cisco_ios_show_lldp_neighbors_detail2.raw', u'invocation': {u'module_args': {u'username': None, u'local_file': None, u'use_keys': False, u'host': None, u'file': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_ios/show_lldp_neighbors_detail/cisco_ios_show_lldp_neighbors_detail2.raw', u'global_delay_factor': u'1', u'password': None, u'port': None, u'index_file': u'index', u'use_templates': True, u'trigger_device_list': None, u'template_dir': u'/Users/jvanderaa/Github/ntc-templates/templates', u'connection_args': {}, u'secret': None, u'delay': u'1', u'platform': u'cisco_ios', u'connection': u'offline', u'command': u'show lldp neighbors detail', u'optional_args': {}, u'provider': None, u'key_file': None}}, u'response': [{u'system_description': u'Cisco NX-OS(tm) n7700, Software (n7700-s2-dk9), Version 6.2(10), RELEASE SOFTWARE Copyright (c) 2002-2013 by Cisco Systems, Inc. Compiled 10/9/2014 12:00:00', u'neighbor_interface': u'PO2631-10Gx2-R261R5', u'local_interface': u'', u'vlan': u'1', u'capabilities': u'B,R', u'neighbor_port_id': u'Eth1/6', u'management_ip': u'11.11.11.11', u'chassis_id': u'a000.f00e.300d', u'neighbor': u'USSC-CAMPUS-CORE-GW2'}, {u'system_description': u'Cisco NX-OS(tm) n7700, Software (n7700-s2-dk9), Version 6.2(10), RELEASE SOFTWARE Copyright (c) 2002-2013 by Cisco Systems, Inc. Compiled 10/9/2014 12:00:00', u'neighbor_interface': u'PO2631-10Gx2-R261R5', u'local_interface': u'', u'vlan': u'1', u'capabilities': u'B,R', u'neighbor_port_id': u'Eth1/6', u'management_ip': u'33.33.33.3', u'chassis_id': u'2222.0642.7333', u'neighbor': u'USSC-CAMPUS-CORE-GW1.acme123.com'}, {u'system_description': u'Cisco IOS Software, C3750 Software (C3750-IPSERVICESK9-M), Version 12.2(53)SE2, RELEASE SOFTWARE (fc3)', u'neighbor_interface': u'GigabitEthernet2/0/24', u'local_interface': u'', u'vlan': u'', u'capabilities': u'B', u'neighbor_port_id': u'Gi2/0/24', u'management_ip': u'55.55.55.55', u'chassis_id': u'0015.2222.c330', u'neighbor': u'DMZ-SW1'}, {u'system_description': u'', u'neighbor_interface': u'', u'local_interface': u'', u'vlan': u'', u'capabilities': u'', u'neighbor_port_id': u'g2', u'management_ip': u'', u'chassis_id': u'0022.1111.2222', u'neighbor': u''}], '_ansible_ignore_errors': None, u'response_list': []}, 'ansible_included_var_files': [u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_ios/show_lldp_neighbors_detail/cisco_ios_show_lldp_neighbors_detail2.parsed'], 'ansible_facts': {u'parsed_sample': [{u'system_description': u'Cisco NX-OS(tm) n7700, Software (n7700-s2-dk9), Version 6.2(10), RELEASE SOFTWARE Copyright (c) 2002-2013 by Cisco Systems, Inc. Compiled 10/9/2014 12:00:00', u'neighbor_interface': u'PO2631-10Gx2-R261R5', u'local_interface': u'', u'vlan': u'1', u'chassis_id': u'a000.f00e.300d', u'neighbor_port_id': u'Eth1/6', u'management_ip': u'11.11.11.11', u'capabilities': u'B,R', u'neighbor': u'USSC-CAMPUS-CORE-GW2'}, {u'system_description': u'Cisco NX-OS(tm) n7700, Software (n7700-s2-dk9), Version 6.2(10), RELEASE SOFTWARE Copyright (c) 2002-2013 by Cisco Systems, Inc. Compiled 10/9/2014 12:00:00', u'neighbor_interface': u'PO2631-10Gx2-R261R5', u'local_interface': u'', u'vlan': u'1', u'chassis_id': u'2222.0642.7333', u'neighbor_port_id': u'Eth1/6', u'management_ip': u'33.33.33.3', u'capabilities': u'B,R', u'neighbor': u'USSC-CAMPUS-CORE-GW1.acme123.com'}, {u'system_description': u'Cisco IOS Software, C3750 Software (C3750-IPSERVICESK9-M), Version 12.2(53)SE2, RELEASE SOFTWARE (fc3)', u'neighbor_interface': u'GigabitEthernet2/0/24', u'local_interface': u'', u'vlan': u'', u'chassis_id': u'0015.2222.c330', u'neighbor_port_id': u'Gi2/0/24', u'management_ip': u'55.55.55.55', u'capabilities': u'B', u'neighbor': u'DMZ-SW1'}, {u'system_description': u'', u'neighbor_interface': u'', u'local_interface': u'', u'vlan': u'', u'chassis_id': u'0022.1111.2222', u'neighbor_port_id': u'g2', u'management_ip': u'', u'capabilities': u'', u'neighbor': u''}]}, '_ansible_ignore_errors': None, '_ansible_item_label': {'_ansible_parsed': True, '_ansible_item_result': True, '_ansible_no_log': False, 'item': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_ios/show_lldp_neighbors_detail/cisco_ios_show_lldp_neighbors_detail2.raw', 'changed': False, 'failed': False, '_ansible_item_label': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_ios/show_lldp_neighbors_detail/cisco_ios_show_lldp_neighbors_detail2.raw', u'invocation': {u'module_args': {u'username': None, u'local_file': None, u'use_keys': False, u'host': None, u'file': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_ios/show_lldp_neighbors_detail/cisco_ios_show_lldp_neighbors_detail2.raw', u'global_delay_factor': u'1', u'password': None, u'port': None, u'index_file': u'index', u'use_templates': True, u'trigger_device_list': None, u'template_dir': u'/Users/jvanderaa/Github/ntc-templates/templates', u'connection_args': {}, u'secret': None, u'delay': u'1', u'platform': u'cisco_ios', u'connection': u'offline', u'command': u'show lldp neighbors detail', u'optional_args': {}, u'provider': None, u'key_file': None}}, u'response': [{u'system_description': u'Cisco NX-OS(tm) n7700, Software (n7700-s2-dk9), Version 6.2(10), RELEASE SOFTWARE Copyright (c) 2002-2013 by Cisco Systems, Inc. Compiled 10/9/2014 12:00:00', u'neighbor_interface': u'PO2631-10Gx2-R261R5', u'local_interface': u'', u'vlan': u'1', u'chassis_id': u'a000.f00e.300d', u'neighbor_port_id': u'Eth1/6', u'management_ip': u'11.11.11.11', u'capabilities': u'B,R', u'neighbor': u'USSC-CAMPUS-CORE-GW2'}, {u'system_description': u'Cisco NX-OS(tm) n7700, Software (n7700-s2-dk9), Version 6.2(10), RELEASE SOFTWARE Copyright (c) 2002-2013 by Cisco Systems, Inc. Compiled 10/9/2014 12:00:00', u'neighbor_interface': u'PO2631-10Gx2-R261R5', u'local_interface': u'', u'vlan': u'1', u'chassis_id': u'2222.0642.7333', u'neighbor_port_id': u'Eth1/6', u'management_ip': u'33.33.33.3', u'capabilities': u'B,R', u'neighbor': u'USSC-CAMPUS-CORE-GW1.acme123.com'}, {u'system_description': u'Cisco IOS Software, C3750 Software (C3750-IPSERVICESK9-M), Version 12.2(53)SE2, RELEASE SOFTWARE (fc3)', u'neighbor_interface': u'GigabitEthernet2/0/24', u'local_interface': u'', u'vlan': u'', u'chassis_id': u'0015.2222.c330', u'neighbor_port_id': u'Gi2/0/24', u'management_ip': u'55.55.55.55', u'capabilities': u'B', u'neighbor': u'DMZ-SW1'}, {u'system_description': u'', u'neighbor_interface': u'', u'local_interface': u'', u'vlan': u'', u'chassis_id': u'0022.1111.2222', u'neighbor_port_id': u'g2', u'management_ip': u'', u'capabilities': u'', u'neighbor': u''}], '_ansible_ignore_errors': None, u'response_list': []}})
ok: [localhost] => (item={'_ansible_item_result': True, '_ansible_no_log': False, 'failed': False, 'changed': False, 'item': {'_ansible_parsed': True, '_ansible_item_result': True, '_ansible_no_log': False, 'item': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_ios/show_lldp_neighbors_detail/cisco_ios_show_lldp_neighbors_detail3.raw', 'changed': False, 'failed': False, '_ansible_item_label': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_ios/show_lldp_neighbors_detail/cisco_ios_show_lldp_neighbors_detail3.raw', u'invocation': {u'module_args': {u'username': None, u'local_file': None, u'use_keys': False, u'host': None, u'file': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_ios/show_lldp_neighbors_detail/cisco_ios_show_lldp_neighbors_detail3.raw', u'global_delay_factor': u'1', u'password': None, u'port': None, u'index_file': u'index', u'use_templates': True, u'trigger_device_list': None, u'template_dir': u'/Users/jvanderaa/Github/ntc-templates/templates', u'connection_args': {}, u'secret': None, u'delay': u'1', u'platform': u'cisco_ios', u'connection': u'offline', u'command': u'show lldp neighbors detail', u'optional_args': {}, u'provider': None, u'key_file': None}}, u'response': [{u'system_description': u'Cisco IP Phone 7962G,V12, SCCP42.9-3-1ES27S', u'neighbor_interface': u'SW PORT', u'local_interface': u'Gi0/1/7', u'vlan': u'', u'capabilities': u'B,T', u'neighbor_port_id': u'C8F9F9D61BC2:P1', u'management_ip': u'10.10.0.1', u'chassis_id': u'10.10.0.1', u'neighbor': u'SEPC8F9F9D61BC2'}], '_ansible_ignore_errors': None, u'response_list': []}, 'ansible_included_var_files': [u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_ios/show_lldp_neighbors_detail/cisco_ios_show_lldp_neighbors_detail3.parsed'], 'ansible_facts': {u'parsed_sample': [{u'system_description': u'Cisco IP Phone 7962G,V12, SCCP42.9-3-1ES27S', u'neighbor_interface': u'SW PORT', u'local_interface': u'Gi0/1/7', u'vlan': u'', u'chassis_id': u'10.10.0.1', u'neighbor_port_id': u'C8F9F9D61BC2:P1', u'management_ip': u'10.10.0.1', u'capabilities': u'B,T', u'neighbor': u'SEPC8F9F9D61BC2'}]}, '_ansible_ignore_errors': None, '_ansible_item_label': {'_ansible_parsed': True, '_ansible_item_result': True, '_ansible_no_log': False, 'item': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_ios/show_lldp_neighbors_detail/cisco_ios_show_lldp_neighbors_detail3.raw', 'changed': False, 'failed': False, '_ansible_item_label': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_ios/show_lldp_neighbors_detail/cisco_ios_show_lldp_neighbors_detail3.raw', u'invocation': {u'module_args': {u'username': None, u'local_file': None, u'use_keys': False, u'host': None, u'file': u'/Users/jvanderaa/Github/ntc-templates/tests/cisco_ios/show_lldp_neighbors_detail/cisco_ios_show_lldp_neighbors_detail3.raw', u'global_delay_factor': u'1', u'password': None, u'port': None, u'index_file': u'index', u'use_templates': True, u'trigger_device_list': None, u'template_dir': u'/Users/jvanderaa/Github/ntc-templates/templates', u'connection_args': {}, u'secret': None, u'delay': u'1', u'platform': u'cisco_ios', u'connection': u'offline', u'command': u'show lldp neighbors detail', u'optional_args': {}, u'provider': None, u'key_file': None}}, u'response': [{u'system_description': u'Cisco IP Phone 7962G,V12, SCCP42.9-3-1ES27S', u'neighbor_interface': u'SW PORT', u'local_interface': u'Gi0/1/7', u'vlan': u'', u'chassis_id': u'10.10.0.1', u'neighbor_port_id': u'C8F9F9D61BC2:P1', u'management_ip': u'10.10.0.1', u'capabilities': u'B,T', u'neighbor': u'SEPC8F9F9D61BC2'}], '_ansible_ignore_errors': None, u'response_list': []}})

PLAY RECAP *****************************************************************************************************************************************************************************************************
localhost                  : ok=3    changed=0    unreachable=0    failed=0

@jvanderaa
Copy link
Contributor Author

I'm not exactly sure how the Travis CI is failing here. I believe that I have the text in the raw files as expected. Everything checks out on the Ansible test. Guidance/help is appreciated.

@kadecole
Copy link
Contributor

kadecole commented Feb 25, 2019

Looks like the issue is with reading the file cisco_ios_show_lldp_neighbors_detail4

****
{'dark': {}, 'response': [{u'system_description': u'ZULTYS IP Phone', u'neighbor_interface': u'WAN PORT', u'local_interface': u'Gi2/0/13', u'vlan': u'', u'chassis_id': u'172.16.4.125', u'neighbor_port_id': u'000b.ea00.16e0', u'management_ip': u'', u'capabilities': u'T', u'neighbor': u'ZULTYS IP Phone'}, {u'system_description': u'Cisco IOS Software, s6t64 Software (s6t64-ADVENTERPRISEK9-M), Version 15.4(1)SY3, RELEASE SOFTWARE (fc4)', u'neighbor_interface': u'asw22 ', u'local_interface': u'Te1/1/1', u'vlan': u'1', u'chassis_id': u'2c33.1100.a6c0', u'neighbor_port_id': u'Te1/2/13', u'management_ip': u'172.16.0.10', u'capabilities': u'B,R', u'neighbor': u'dsw01'}], 'contacted': {'localhost': {'invocation': {'module_name': 'include_vars', 'module_args': u'tests/cisco_ios/show_lldp_neighbors_detail/cisco_ios_show_lldp_neighbors_detail4.parsed'}, 'ansible_facts': {'parsed_sample': [{'system_description': 'ZULTYS IP Phone', 'neighbor_interface': 'WAN PORT', 'local_interface': 'Gi2/0/13', 'vlan': '', 'chassis_id': '172.16.4.125', 'neighbor_port_id': '000b.ea00.16e0', 'management_ip': '', 'capabilities': 'T', 'neighbor': 'ZULTYS IP Phone'}, {'system_description': 'Cisco IOS Software, s6t64 Software (s6t64-ADVENTERPRISEK9-M), Version 15.4(1)SY3, RELEASE SOFTWARE (fc4)', 'neighbor_interface': 'asw22', 'local_interface': 'Te1/1/1', 'vlan': '', 'chassis_id': '2c33.1100.a6c0', 'neighbor_port_id': 'Te1/2/13', 'management_ip': '172.16.0.10', 'capabilities': 'B,R', 'neighbor': 'dsw01'}]}}}}
****
cisco_ios_show_lldp_neighbors_detail4
----> failed
msg:
{u'system_description': u'Cisco IOS Software, s6t64 Software (s6t64-ADVENTERPRISEK9-M), Version 15.4(1)SY3, RELEASE SOFTWARE (fc4)', u'neighbor_interface': u'asw22 ', u'local_interface': u'Te1/1/1', u'vlan': u'1', u'chassis_id': u'2c33.1100.a6c0', u'neighbor_port_id': u'Te1/2/13', u'management_ip': u'172.16.0.10', u'capabilities': u'B,R', u'neighbor': u'dsw01'} is not found in sample input
****************************************************************************************************
parsed (from parsed file): 
[{'system_description': 'ZULTYS IP Phone', 'neighbor_interface': 'WAN PORT', 'local_interface': 'Gi2/0/13', 'vlan': '', 'chassis_id': '172.16.4.125', 'neighbor_port_id': '000b.ea00.16e0', 'management_ip': '', 'capabilities': 'T', 'neighbor': 'ZULTYS IP Phone'}, {'system_description': 'Cisco IOS Software, s6t64 Software (s6t64-ADVENTERPRISEK9-M), Version 15.4(1)SY3, RELEASE SOFTWARE (fc4)', 'neighbor_interface': 'asw22', 'local_interface': 'Te1/1/1', 'vlan': '', 'chassis_id': '2c33.1100.a6c0', 'neighbor_port_id': 'Te1/2/13', 'management_ip': '172.16.0.10', 'capabilities': 'B,R', 'neighbor': 'dsw01'}]
****************************************************************************************************
result (from ntc_show_command): 
[{u'system_description': u'ZULTYS IP Phone', u'neighbor_interface': u'WAN PORT', u'local_interface': u'Gi2/0/13', u'vlan': u'', u'chassis_id': u'172.16.4.125', u'neighbor_port_id': u'000b.ea00.16e0', u'management_ip': u'', u'capabilities': u'T', u'neighbor': u'ZULTYS IP Phone'}, {u'system_description': u'Cisco IOS Software, s6t64 Software (s6t64-ADVENTERPRISEK9-M), Version 15.4(1)SY3, RELEASE SOFTWARE (fc4)', u'neighbor_interface': u'asw22 ', u'local_interface': u'Te1/1/1', u'vlan': u'1', u'chassis_id': u'2c33.1100.a6c0', u'neighbor_port_id': u'Te1/2/13', u'management_ip': u'172.16.0.10', u'capabilities': u'B,R', u'neighbor': u'dsw01'}]

@jvanderaa
Copy link
Contributor Author

I see now. Will update and fix tonight yet.

@FragmentedPacket
Copy link
Contributor

My attempt at linking the two (issue to PR)

Fixes #374

@FragmentedPacket FragmentedPacket merged commit f72a71f into networktocode:master Jul 19, 2019
jvanderaa added a commit that referenced this pull request Nov 10, 2021
#377)

* Updated cisco_ios_show_lldp_neighbor_detail template with lenient accountancy for physical media capabilities
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

Successfully merging this pull request may close these issues.

3 participants