]> git.proxmox.com Git - mirror_frr.git/commitdiff
Make vtysh-integrated-config truly the default and fix quagga reload for this.
authorDinesh G Dutt <ddutt@cumulusnetworks.com>
Wed, 20 Jul 2016 15:24:47 +0000 (08:24 -0700)
committerDinesh G Dutt <ddutt@cumulusnetworks.com>
Wed, 20 Jul 2016 16:14:27 +0000 (09:14 -0700)
Ticket: CM-11910
Reviewed By: sharpd, routing-dev slack
Testing Done: Test with nothing in vtysh.conf, add no, remove it etc.

Even though we force integrated config to be the default, we do this by adding
a line to our default vtysh.conf which has integrated config enabled. When we
stopped printing integrated-config as part of wr mem or show running-config, we
broke quagga reload because it was explicitly looking for integrated config.
Furthermore, merely fixing quagga reload wouldn't work because subsequent saves
would result in config being saved to individual files since vtysh.conf no
longer forced the file to be integrated.

This patch fixes both issues. Makes integrated config the default in the code,
rather than via a shipped default file, and fixes quagga reload to look for
the "no integrated-vtysh-config" to deny attempting a reload.

tools/quagga-reload.py
vtysh/vtysh.c

index 22d44b3369e502fae1cb12870001b50697e73989..f90b3e95fc87712b2e519d2509a029f8511251ec 100755 (executable)
@@ -708,15 +708,15 @@ if __name__ == '__main__':
 
     # Verify that 'service integrated-vtysh-config' is configured
     vtysh_filename = '/etc/quagga/vtysh.conf'
-    service_integrated_vtysh_config = False
+    service_integrated_vtysh_config = True
 
     if os.path.isfile(vtysh_filename):
         with open(vtysh_filename, 'r') as fh:
             for line in fh.readlines():
                 line = line.strip()
 
-                if line == 'service integrated-vtysh-config':
-                    service_integrated_vtysh_config = True
+                if line == 'no service integrated-vtysh-config':
+                    service_integrated_vtysh_config = False
                     break
 
     if not service_integrated_vtysh_config:
index abd5d04f44d77aebfa06144756f8c7f94beda0be..ad43f41fd9d3b31b929e3b21cc6453f1c7c0c405 100644 (file)
@@ -71,7 +71,7 @@ struct vtysh_client vtysh_client[] =
 };
 
 /* Using integrated config from Quagga.conf. Default is no. */
-int vtysh_writeconfig_integrated = 0;
+int vtysh_writeconfig_integrated = 1;
 
 extern char config_default[];