From 0eb886160244456db55e78e246c1c0c20302aba2 Mon Sep 17 00:00:00 2001 From: Michel Nederlof Date: Thu, 18 Jan 2024 10:26:32 +0100 Subject: [PATCH] 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 --- ovn_bgp_agent/privileged/vtysh.py | 3 +-- ovn_bgp_agent/tests/unit/privileged/test_vtysh.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/ovn_bgp_agent/privileged/vtysh.py b/ovn_bgp_agent/privileged/vtysh.py index ddd9a540..df8287fb 100644 --- a/ovn_bgp_agent/privileged/vtysh.py +++ b/ovn_bgp_agent/privileged/vtysh.py @@ -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: diff --git a/ovn_bgp_agent/tests/unit/privileged/test_vtysh.py b/ovn_bgp_agent/tests/unit/privileged/test_vtysh.py index 89434cf9..49d19b8a 100644 --- a/ovn_bgp_agent/tests/unit/privileged/test_vtysh.py +++ b/ovn_bgp_agent/tests/unit/privileged/test_vtysh.py @@ -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()