flag added foy vyos_interface module (#57124)

Signed-off-by: rohitthakur2590 <rohitthakur2590@outlook.com>
This commit is contained in:
Rohit 2019-06-06 18:23:19 +05:30 committed by GitHub
parent ae5d3d76f6
commit a87de8d7b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 3 deletions

View file

@ -227,7 +227,7 @@ def map_obj_to_commands(updates):
def map_config_to_obj(module): def map_config_to_obj(module):
data = get_config(module) data = get_config(module, flags=['| grep interface'])
obj = [] obj = []
for line in data.split('\n'): for line in data.split('\n'):
if line.startswith('set interfaces ethernet'): if line.startswith('set interfaces ethernet'):

View file

@ -71,10 +71,18 @@ class Cliconf(CliconfBase):
if format not in option_values['format']: if format not in option_values['format']:
raise ValueError("'format' value %s is invalid. Valid values of format are %s" % (format, ', '.join(option_values['format']))) raise ValueError("'format' value %s is invalid. Valid values of format are %s" % (format, ', '.join(option_values['format'])))
if not flags:
flags = []
if format == 'text': if format == 'text':
out = self.send_command('show configuration') command = 'show configuration'
else: else:
out = self.send_command('show configuration commands') command = 'show configuration commands'
command += ' '.join(to_list(flags))
command = command.strip()
out = self.send_command(command)
return out return out
def edit_config(self, candidate=None, commit=True, replace=None, comment=None): def edit_config(self, candidate=None, commit=True, replace=None, comment=None):