]> git.proxmox.com Git - mirror_frr.git/commit - vtysh/vtysh.c
vtysh: Set an erroneous exit code if dry run fails because of syntax error
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 9 Mar 2016 12:25:02 +0000 (07:25 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 9 Mar 2016 12:25:02 +0000 (07:25 -0500)
commit3221dca81ea45765bb8707fa81cf8f1c6da36f71
treedc1a3cf572c4dc05990d99ef67b7d78880760c20
parenta4c52804ac934bd43e6ed4957fa0b8dbc61d6f89
vtysh: Set an erroneous exit code if dry run fails because of syntax error

vtysh has a -C option to do a dry run of the quagga commands. However, the
program always returns 0 even when there's an error detected in the command.
Furthermore, it only parses vtysh.conf, not Quagga.conf.

This patch makes vtysh -C parse Quagga.conf also and return a non-zero
exit code so that network automation tools can catch this to flag errors in
syntax. This non-zero exit code along with printing the exact error with the
line number and offending line itself should help in fixing the error. But
this lack of proper error code requires the automation tools to go through
an additional hoop to validate the syntax.

Signed-off-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
vtysh/vtysh.c
vtysh/vtysh.h
vtysh/vtysh_config.c
vtysh/vtysh_main.c