napalm-automation-community / napalm-panos

NAPALM driver for PAN-OS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

naplam-panos: get_lldp_neighbors not working

netwninja opened this issue · comments

Description of Issue/Question

Did you follow the steps from https://github.com/napalm-automation/napalm#faq

  • [X ] Yes
  • No

Setup

napalm-sever------PA-FW

napalm-panos version

(Paste verbatim output from pip freeze | grep napalm-panos between quotes below)

napalm==2.5.0
napalm-base==1.0.0
napalm-eos==0.6.1
napalm-ios==0.8.1
napalm-panos==0.5.2

PanOS version

(Paste verbatim output from show system info between quotes below)

ansible@PA1> show system info | match sw
sw-version: 7.0.1
ansible@PA1> 

Steps to Reproduce the Issue

Use the below python script

cat pan1.py 
import json
from napalm import get_network_driver
driver = get_network_driver('panos')
dev = driver(hostname='10.0.0.189', username='ansible', password='ansible123')
dev.open()
dev_info = dev.get_lldp_neighbors()
dev.close()
print(json.dumps(dev_info, sort_keys=True, indent=4))

Error Traceback

(Paste the complete traceback of the exception between quotes below)

python pan1.py 
Traceback (most recent call last):
  File "pan1.py", line 6, in <module>
    dev_info = dev.get_lldp_neighbors()
  File "/usr/local/lib/python2.7/dist-packages/napalm_panos/panos.py", line 414, in get_lldp_neighbors
    local_int = lldp_item['@name']
TypeError: string indices must be integers

Here are the screenshots from PA UI API browser which is working fine.

Screen Shot 2019-10-12 at 2 28 41 PM

Screen Shot 2019-10-12 at 2 28 52 PM

Updated in develop. Being a bad maintainer right now, but there is some issues I need to work through. You should be able to install from the develop branch (follow https://stackoverflow.com/questions/20101834/pip-install-from-git-repo-branch for instructions).