Replace invalid_params with ValueError (#44545)

This commit is contained in:
Lindsay Hill 2018-08-23 06:49:08 -07:00 committed by Ricardo Carrillo Cruz
parent d4e15d40e8
commit 6c05e03fea
5 changed files with 6 additions and 6 deletions

View file

@ -51,7 +51,7 @@ class Cliconf(CliconfBase):
@enable_mode
def get_config(self, source='running', format='text', flags=None):
if source not in ('running', 'startup'):
return self.invalid_params("fetching configuration from %s is not supported" % source)
raise ValueError("fetching configuration from %s is not supported" % source)
if source == 'running':
cmd = b'show running-config'
@ -61,7 +61,7 @@ class Cliconf(CliconfBase):
else:
cmd = b'show configuration'
if flags is not None:
return self.invalid_params("flags are only supported with running-config")
raise ValueError("flags are only supported with running-config")
return self.send_command(cmd)