diff --git a/.gitignore b/.gitignore index a6efb9e62..0e6ece359 100644 --- a/.gitignore +++ b/.gitignore @@ -60,4 +60,5 @@ env napalm/fix_script.sh test/unit/ios/*.conf - +test/unit/test_devices.py +test/unit/test_devices.pyc diff --git a/napalm/iosxr.py b/napalm/iosxr.py index 9eff865ce..274bd54c1 100644 --- a/napalm/iosxr.py +++ b/napalm/iosxr.py @@ -335,8 +335,8 @@ def generate_vrf_query(vrf_name): this_neighbor['is_enabled'] = True try: this_neighbor['description'] = unicode(neighbor.find('Description').text) - except: - pass + except AttributeError: + this_neighbor['description'] = u'' this_neighbor['is_enabled'] = str(neighbor.find('ConnectionAdminStatus').text) is "1" @@ -378,7 +378,7 @@ def generate_vrf_query(vrf_name): try: neighbor_ip = unicode(neighbor.find('Naming/NeighborAddress/IPV4Address').text) - except: + except AttributeError: neighbor_ip = unicode(neighbor.find('Naming/NeighborAddress/IPV6Address').text) neighbors[neighbor_ip] = this_neighbor @@ -576,8 +576,6 @@ def get_lldp_neighbors(self): # init result dict lldp = {} - - # fetch sh ip bgp output sh_lldp = self.device.show_lldp_neighbors().splitlines()[5:-3] for n in sh_lldp: