Commit Graph

3 Commits (afc4e16551b9eb7bdc0f686ad8236e4570db03cd)

Author SHA1 Message Date
Sébastien Gross 7c9217a8f7 [lldp] Merge wrapped lines.
Some devices return their description on multiple lines such as:

    lldp.eth0.chassis.descr=cisco CISCO7609-S running on
    Cisco IOS Software, c7600s72033_rp Software (c7600s72033_rp-IPSERVICESK9-M), Version 12.2(33)SRE3, RELEASE SOFTWARE (fc1)
    Technical Support: http://www.cisco.com/techsupport
    Copyright (c) 1986-2011 by Cisco Systems, Inc.
    Compiled Wed 26-Jan-11 06:54 by prod_rel_team

The generated fact will result as:

    "descr": "cisco CISCO7609-S running on"

This patch fixes the line wrapping to return the full description
handling line breaks:

    "descr": "cisco CISCO7609-S running on\nCisco IOS Software, c7600s72033_rp Software (c7600s72033_rp-IPSERVICESK9-M), Version 12.2(33)SRE3, RELEASE SOFTWARE (fc1)\nTechnical Support: http://www.cisco.com/techsupport\nCopyright (c) 1986-2011 by Cisco Systems, Inc.\nCompiled Wed 26-Jan-11 06:54 by prod_rel_team"
10 years ago
Chad Norgan 8c94dd8b47 Ignore lines that do not have the key in them
Some switches return multi-line output, which breaks the split function,
the change seeks to only preform the split on a line that has the key.
10 years ago
Michael DeHaan 1e777bb508 Fix rename error. 10 years ago