Skip to content

Commit

Permalink
Add check for missing argument
Browse files Browse the repository at this point in the history
  • Loading branch information
phil-dileo committed Sep 16, 2015
1 parent 10ebb14 commit 535de13
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pyeapi/api/bgp.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,17 @@ def set_router_id(self, value=None, default=False):

def set_maximum_paths(self, max_path=None, max_ecmp_path=None, default=False):
# You cannot configure max_ecmp_path without max_paths
if not max_path and max_ecmp_path:
raise TypeError('Cannot use maximum_ecmp_paths without'
'providing max_path')
if default:
cmd = 'default maximum-paths'
elif max_path:
cmd = 'maximum-paths {}'.format(max_path)
if max_ecmp_path:
cmd += ' ecmp {}'.format(max_ecmp_path)
else:
cmd = 'default maximum-paths'
cmd = 'no maximum-paths'
return self.configure_bgp(cmd)

def set_shutdown(self, value=None, default=False):
Expand Down

0 comments on commit 535de13

Please sign in to comment.