Skip to content

Commit

Permalink
Merge pull request #153 from ktbyers/cisco_ios_scp
Browse files Browse the repository at this point in the history
iosxr remove bare except statements
  • Loading branch information
dbarrosop committed Feb 7, 2016
2 parents 0f5d696 + 1eadb45 commit 2a6b268
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,5 @@ env

napalm/fix_script.sh
test/unit/ios/*.conf

test/unit/test_devices.py
test/unit/test_devices.pyc
8 changes: 3 additions & 5 deletions napalm/iosxr.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 2a6b268

Please sign in to comment.