vty: Check with the application before writing the config
For the BSC/NITB application we see that people modify the band
without modifying the ARFCN. This creates an unbootable config.
Using the new hook the BSC/NITB can check if the config is
consistent and prevent the config file being written.
Related: SYS#739
diff --git a/src/vty/command.c b/src/vty/command.c
index 44a1b6c..3ff5f77 100644
--- a/src/vty/command.c
+++ b/src/vty/command.c
@@ -2497,6 +2497,15 @@
char *failed_file;
int rc;
+ if (host.app_info->config_is_consistent) {
+ rc = host.app_info->config_is_consistent(vty);
+ if (!rc) {
+ vty_out(vty, "Configuration is not consistent%s",
+ VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+ }
+
if (host.config == NULL) {
vty_out(vty, "Can't save to configuration file, using vtysh.%s",
VTY_NEWLINE);