Skip to content

Commit 2a6b268

Browse files
committed
Merge pull request #153 from ktbyers/cisco_ios_scp
iosxr remove bare except statements
2 parents 0f5d696 + 1eadb45 commit 2a6b268

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,5 @@ env
6060

6161
napalm/fix_script.sh
6262
test/unit/ios/*.conf
63-
63+
test/unit/test_devices.py
64+
test/unit/test_devices.pyc

napalm/iosxr.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -335,8 +335,8 @@ def generate_vrf_query(vrf_name):
335335
this_neighbor['is_enabled'] = True
336336
try:
337337
this_neighbor['description'] = unicode(neighbor.find('Description').text)
338-
except:
339-
pass
338+
except AttributeError:
339+
this_neighbor['description'] = u''
340340

341341
this_neighbor['is_enabled'] = str(neighbor.find('ConnectionAdminStatus').text) is "1"
342342

@@ -378,7 +378,7 @@ def generate_vrf_query(vrf_name):
378378

379379
try:
380380
neighbor_ip = unicode(neighbor.find('Naming/NeighborAddress/IPV4Address').text)
381-
except:
381+
except AttributeError:
382382
neighbor_ip = unicode(neighbor.find('Naming/NeighborAddress/IPV6Address').text)
383383

384384
neighbors[neighbor_ip] = this_neighbor
@@ -576,8 +576,6 @@ def get_lldp_neighbors(self):
576576

577577
# init result dict
578578
lldp = {}
579-
580-
# fetch sh ip bgp output
581579
sh_lldp = self.device.show_lldp_neighbors().splitlines()[5:-3]
582580

583581
for n in sh_lldp:

0 commit comments

Comments
 (0)