From f1a05de982b2466907838a7e74d7d15ad4060db2 Mon Sep 17 00:00:00 2001 From: Daniel Walton Date: Thu, 13 Jul 2017 19:56:08 +0000 Subject: vtysh: return non-zero for configuration failures Signed-off-by: Daniel Walton This allows frr-reload.py (or anything else that scripts via vtysh) to know if the vtysh command worked or hit an error. --- eigrpd/eigrp_vty.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'eigrpd/eigrp_vty.c') diff --git a/eigrpd/eigrp_vty.c b/eigrpd/eigrp_vty.c index e283c7365..5b48ab79b 100644 --- a/eigrpd/eigrp_vty.c +++ b/eigrpd/eigrp_vty.c @@ -236,7 +236,7 @@ DEFUN (no_router_eigrp, if (eigrp->AS != atoi (argv[3]->arg)) { vty_outln (vty,"%% Attempting to deconfigure non-existent AS"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } eigrp_finish_final (eigrp); @@ -394,7 +394,7 @@ DEFUN (eigrp_network, if (ret == 0) { vty_outln (vty, "There is already same network statement."); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; @@ -418,7 +418,7 @@ DEFUN (no_eigrp_network, if (ret == 0) { vty_outln (vty,"Can't find specified network configuration."); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; @@ -866,7 +866,7 @@ str2auth_type (const char *str, struct interface *ifp) { /* Sanity check. */ if (str == NULL) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; if(strncmp(str, "md5",3) == 0) { @@ -879,7 +879,7 @@ str2auth_type (const char *str, struct interface *ifp) return CMD_SUCCESS; } - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } DEFUN (eigrp_authentication_mode, @@ -1032,7 +1032,7 @@ DEFUN (eigrp_redistribute_source_metric, argv_find (argv, argc, "redistribute", &idx); source = proto_redistnum(AFI_IP, argv[idx+1]->arg); if (source < 0 ) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; /* Get metrics values */ @@ -1061,7 +1061,7 @@ DEFUN (no_eigrp_redistribute_source_metric, argv_find (argv, argc, "redistribute", &idx); source = proto_redistnum(AFI_IP, argv[idx+1]->arg); if (source < 0 ) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; /* Get metrics values */ -- cgit v1.2.3