diff options
| -rw-r--r-- | python/vyos/frrender.py | 8 | 
1 files changed, 7 insertions, 1 deletions
diff --git a/python/vyos/frrender.py b/python/vyos/frrender.py index 95d6c7243..7221d5053 100644 --- a/python/vyos/frrender.py +++ b/python/vyos/frrender.py @@ -136,7 +136,7 @@ class FRRender:              output += '\n'          if 'vrf' in config and 'name' in config['vrf']: -            output += render_to_string('frr/zebra.vrf.route-map.frr.j2', config['vrf']) + '\n' +            output += render_to_string('frr/zebra.vrf.route-map.frr.j2', config['vrf'])              for vrf, vrf_config in config['vrf']['name'].items():                  if 'protocols' not in vrf_config:                      continue @@ -145,6 +145,12 @@ class FRRender:                  output += inline_helper(vrf_config['protocols']) +        # remove any accidently added empty newline to not confuse FRR +        output = os.linesep.join([s for s in output.splitlines() if s]) + +        if '!!' in output: +            raise ConfigError('FRR configuration contains "!!" which is not allowed') +          debug(output)          debug('======< RENDERING CONFIG COMPLETE >======')          write_file(self._frr_conf, output)  | 
