Fix FRR 9 mgmtd crashes when applying config

The vrysh command also allows reading from file and when using
this option, it works perfectly.

Closes-Bug: #2049736

Change-Id: I6cbee6739d8dddb43118585d1c03ad3eda8e4cbf
(cherry picked from commit 0eb8861602)
This commit is contained in:
Michel Nederlof 2024-01-18 10:26:32 +01:00 committed by Luis Tomas Bolivar
parent 1f9a32c91a
commit f3420b9939
2 changed files with 2 additions and 3 deletions

View File

@ -23,9 +23,8 @@ LOG = logging.getLogger(__name__)
@ovn_bgp_agent.privileged.vtysh_cmd.entrypoint
def run_vtysh_config(frr_config_file):
vtysh_command = "copy {} running-config".format(frr_config_file)
full_args = ['/usr/bin/vtysh', '--vty_socket', constants.FRR_SOCKET_PATH,
'-c', vtysh_command]
'-f', frr_config_file]
try:
return processutils.execute(*full_args)
except Exception as e:

View File

@ -43,7 +43,7 @@ class TestPrivilegedVtysh(test_base.TestCase):
vtysh.run_vtysh_config('/fake/frr.config')
self.mock_exc.assert_called_once_with(
'/usr/bin/vtysh', '--vty_socket', constants.FRR_SOCKET_PATH,
'-c', 'copy /fake/frr.config running-config')
'-f', '/fake/frr.config')
def test_run_vtysh_config_exception(self):
self.mock_exc.side_effect = FakeException()