Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Updated the template to get first 20 chars on LLDP neighbor for case … #376

Merged
merged 2 commits into from
Feb 25, 2019
Merged

Conversation

jvanderaa
Copy link
Contributor

…of longer switch names.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT

cisco_ios_show_lldp_neighbors.template

SUMMARY

After help from @FragmentedPacket I have finally added in the update to get the proper name.

Fixes #375 (missed the commit message, let me know if that is needed as well yet on top of in here).

Before

PLAY [Switch config] *********************************************************************************************************************************************************************************************

TASK [CLI >> Get LLDP neighbors] *********************************************************************************************************************************************************************************
ok: [rtr01]

TASK [SYS >> Parse LLDP Information] *****************************************************************************************************************************************************************************
ok: [rtr01]

TASK [DEBUG >> LLDP Neighbors] ***********************************************************************************************************************************************************************************
ok: [rtr01] => {
    "msg": []
}

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

After

PLAY [Switch config] *********************************************************************************************************************************************************************************************

TASK [CLI >> Get LLDP neighbors] *********************************************************************************************************************************************************************************
ok: [rtr01]

TASK [SYS >> Parse LLDP Information] *****************************************************************************************************************************************************************************
ok: [rtr01]

TASK [DEBUG >> LLDP Neighbors] ***********************************************************************************************************************************************************************************
ok: [rtr01] => {
    "msg": [
        {
            "LOCAL_INTERFACE": "Gi0/2",
            "NEIGHBOR": "sw01.josh-v.com",
            "NEIGHBOR_INTERFACE": "Gi0/0"
        }
    ]
}

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

Copy link
Contributor

@jmcgill298 jmcgill298 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how Travis is passing, but this definitely doesn't capture the data for the original raw file; \s* will allow, but not require a space, which should account for both scenarios.

Co-Authored-By: jvanderaa <joshvanderaa@gmail.com>
@jvanderaa
Copy link
Contributor Author

I was noticing a few tests were having some challenges locally as well. Like before the changes to the template the test-template.yml playbook would still succeed even without having actual data. Looking closer at the test runs I should have seen the failure on the original test.

The update makes sense at this point. Appreciate it!

@jmcgill298 jmcgill298 merged commit 860a302 into networktocode:master Feb 25, 2019
@jmcgill298 jmcgill298 mentioned this pull request Oct 9, 2019
jvanderaa added a commit that referenced this pull request Nov 10, 2021
Fix template not accounting for neighbor name running into interface name.

TEMPLATE UPDATES:
  - Limit `NEIGHBOR` capture group to first 20 non-space characters.
  - Change space capture from being required to being allowed

TEST UPDATES:
  - Add new raw/parsed files to account for additional output
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

show_lldp_neighbors.template failing when switch + domain name is > 19 characters
2 participants