Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

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.
  • Loading branch information...
beardymcbeards committed Feb 27, 2015
1 parent bb886a5 commit 8c94dd8b474e116feb5cea928282f6a7577d46ee
Showing with 1 addition and 1 deletion.
  1. +1 −1 network/lldp.py
@@ -54,7 +54,7 @@ def gather_lldp():
lldp_entries = output.split("\n")

for entry in lldp_entries:
if entry:
if entry.startswith('lldp'):
path, value = entry.strip().split("=", 1)
path = path.split(".")
path_components, final = path[:-1], path[-1]

0 comments on commit 8c94dd8

Please sign in to comment.
You can’t perform that action at this time.