From 4b78098d79d97abef352345221c3979efab1c373 Mon Sep 17 00:00:00 2001 From: Dinesh G Dutt Date: Thu, 5 Jan 2017 18:49:13 -0800 Subject: [PATCH] tools: Don't overwrite Quagga.conf on reload, unless user specified. Ticket: CM-14059 Reviewed By: CCR-5524 Testing Done: the usual At some point in the 3.x release cycle, it was decided to overwrite the user's Quagga.conf configuration file with the output of running config when the user did a quagga reload. This is problematic for several reasons such as: losing user-specified comments, upsetting network automation scripts which think some thing has changed all the time from the specified config etc. This patch fixes this issue by not overwriting the Quagga.conf file unless the user specifies it via an additional option, or the file being used as input to quagga reload isn't the default configuration file (incl. path). Signed-off-by: Dinesh Dutt --- tools/frr-reload.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/frr-reload.py b/tools/frr-reload.py index e14d78d54c..729f817d63 100755 --- a/tools/frr-reload.py +++ b/tools/frr-reload.py @@ -732,6 +732,7 @@ if __name__ == '__main__': parser.add_argument('--debug', action='store_true', help='Enable debugs', default=False) parser.add_argument('--stdout', action='store_true', help='Log to STDOUT', default=False) parser.add_argument('filename', help='Location of new frr config file') + parser.add_argument('--overwrite', action='store_true', help='Overwrite Quagga.conf with running config output', default=False) args = parser.parse_args() # Logging @@ -939,5 +940,6 @@ if __name__ == '__main__': subprocess.call(['/usr/bin/vtysh', '-f', filename]) os.unlink(filename) - # Make these changes persistent + # Make these changes persistent + if args.overwrite or args.filename != '/etc/quagga/Quagga.conf': subprocess.call(['/usr/bin/vtysh', '-c', 'write']) -- 2.39.5