diff options
Diffstat (limited to 'python/vyos/frr.py')
| -rw-r--r-- | python/vyos/frr.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/python/vyos/frr.py b/python/vyos/frr.py index 69c7a14ce..df6849472 100644 --- a/python/vyos/frr.py +++ b/python/vyos/frr.py @@ -68,6 +68,8 @@ Apply the new configuration: import tempfile import re from vyos import util +from vyos.util import chown +from vyos.util import cmd import logging from logging.handlers import SysLogHandler import os @@ -86,6 +88,7 @@ _frr_daemons = ['zebra', 'bgpd', 'fabricd', 'isisd', 'ospf6d', 'ospfd', 'pbrd', path_vtysh = '/usr/bin/vtysh' path_frr_reload = '/usr/lib/frr/frr-reload.py' +path_config = '/run/frr' class FrrError(Exception): @@ -200,13 +203,26 @@ def reload_configuration(config, daemon=None): for i, e in enumerate(output.split('\n')): LOG.debug(f'frr-reload output: {i:3} {e}') if code == 1: - raise CommitError(f'Configuration FRR failed while commiting code, please enabling debugging to examine logs') + raise CommitError('FRR configuration failed while running commit. Please ' \ + 'enable debugging to examine logs.\n\n\n' \ + 'To enable debugging run: "touch /tmp/vyos.frr.debug" ' \ + 'and "sudo systemctl stop vyos-configd"') elif code: raise OSError(code, output) return output +def save_configuration(): + """Save FRR configuration to /run/frr/config/frr.conf + It save configuration on each commit. T3217 + """ + + cmd(f'{path_vtysh} -n -w') + + return + + def execute(command): """ Run commands inside vtysh command: str containing commands to execute inside a vtysh session |
