diff options
| author | Daniel Walton <dwalton@cumulusnetworks.com> | 2016-09-30 15:31:48 +0000 |
|---|---|---|
| committer | Daniel Walton <dwalton@cumulusnetworks.com> | 2016-09-30 15:31:48 +0000 |
| commit | 6de69f83055163cfc4015d609de3750af8fbff52 (patch) | |
| tree | 7ad0153279cbf4903e261c0d95466088b61e80a1 /tools/argv_translator.py | |
| parent | 7a7be51923d07bbacda978fd35b805b22d65fd31 (diff) | |
all: added some missing <>s within []s
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Diffstat (limited to 'tools/argv_translator.py')
| -rwxr-xr-x | tools/argv_translator.py | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/tools/argv_translator.py b/tools/argv_translator.py index 02e7bac68f..af88475d21 100755 --- a/tools/argv_translator.py +++ b/tools/argv_translator.py @@ -684,9 +684,26 @@ DEFUN (no_bgp_maxmed_onstartup, if not line.endswith('\n'): line += '\n' + if '|<' in line: + print "%d: ERROR |< is illegal in '%s'" % (self.line_number, line) + + if '|[' in line: + print "%d: ERROR |[ is illegal in '%s'" % (self.line_number, line) + # compress duplicate whitespaces re_space = re.search('^(\s*).*(\s*)$', line) line = re_space.group(1) + ' '.join(line.split()) + re_space.group(2) + + for token in line_to_tokens(self.line_number, line): + token = token.strip() + + if token.endswith('",'): + token = token[0:-2] + + if token.startswith('[') and '|' in token: + if not token.startswith('[<') or not token.endswith('>]'): + print "%s: suspend token '%s'" % (self.line_number, token) + return line def get_used_idx_variables(self, idx_table): @@ -743,8 +760,9 @@ DEFUN (no_bgp_maxmed_onstartup, return False def dump(self): - new_command_string = self.get_new_command_string() - new_command_string_expanded = expand_command_string(new_command_string) + # new_command_string = self.get_new_command_string() + # new_command_string_expanded = expand_command_string(new_command_string) + new_command_string_expanded = self.get_new_command_string() lines = [] lines.append("DEFUN (%s,\n" % self.name) @@ -898,7 +916,6 @@ def update_argvs(filename): state = None fh.write(line) elif line.strip().startswith('* ') and not line.strip().startswith('* '): - # dwalton new_line = expand_command_string(line[3:]) # chop the leading " * " fh.write(" * %s" % new_line) else: |
