Closed biwhite closed 7 years ago
Actually, it looks like it should be a list rather than a dict
This fixes the case when there's zero or 1 interface in a VRF. If there's zero, the previous code threw an exception. If there was one, it would return each character of that interface name as a separate interface. This PR addresses both issues, by ensuring the variable iterated over is set to a list containing zero or more interfaces.
Thanks @biwhite
I found a VRF without any interfaces in it causes this to happen.
INFO:ncclient.operations.rpc:Requesting 'ExecuteRpc' Traceback (most recent call last): File "./modeller.py", line 140, in
sys.exit(main())
File "./modeller.py", line 114, in main
data = nd.get_network_instances()
File "/usr/local/lib/python2.7/dist-packages/napalm_junos/junos.py", line 1541, in get_network_instances
intrf_name: {} for intrf_name in ri_interfaces if intrf_name
TypeError: 'NoneType' object is not iterable
Segmentation fault (core dumped)