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

LLDP Neighbor update #40

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions napalm_panos/panos.py
Expand Up @@ -398,8 +398,10 @@ def get_lldp_neighbors(self):

if local_int not in neighbors.keys():
neighbors[local_int] = []

lldp_neighs = lldp_item['neighbors']['entry']
try:
lldp_neighs = lldp_item.get('neighbors').get('entry')
except AttributeError:
lldp_neighs = ''
if isinstance(lldp_neighs, dict):
lldp_neighs = [lldp_neighs]

Expand Down
@@ -0,0 +1,18 @@
<response status="success">
<result>
<entry name="ethernet1/1">
<local>
<index>16</index>
<port-id>1</port-id>
</local>
<neighbors></neighbors>
</entry>
<entry name="ethernet1/2">
<local>
<index>17</index>
<port-id>2</port-id>
</local>
<neighbors></neighbors>
</entry>
</result>
</response>
@@ -0,0 +1 @@
{"ethernet1/1": [], "ethernet1/2": []}