diff options
| author | Russ White <russ@riw.us> | 2017-07-14 06:24:01 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-07-14 06:24:01 -0400 |
| commit | 905c15079393987f8cfdd55c30e7e1a3248c8c48 (patch) | |
| tree | 0a210b213a525f2880cd694b2e45833e8430d282 /lib/command.c | |
| parent | 2ddcf30b2a523ca760b32b1a72fd2f16a6c5dc89 (diff) | |
| parent | f1a05de982b2466907838a7e74d7d15ad4060db2 (diff) | |
Merge pull request #815 from dwalton76/CMD_WARNING_take2
vtysh: return non-zero for configuration failures
Diffstat (limited to 'lib/command.c')
| -rw-r--r-- | lib/command.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/command.c b/lib/command.c index 5ca4a0fda9..bf36a43d3d 100644 --- a/lib/command.c +++ b/lib/command.c @@ -1150,7 +1150,7 @@ DEFUN (config_terminal, else { vty_outln (vty, "VTY configuration is locked by other VTY"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; } @@ -1722,7 +1722,7 @@ DEFUN (config_hostname, if (!isalpha((int) word->arg[0])) { vty_outln (vty, "Please specify string starting with alphabet"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return cmd_hostname_set (word->arg); @@ -1763,7 +1763,7 @@ DEFUN (config_password, { vty_outln (vty, "Please specify string starting with alphanumeric"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (host.password) @@ -1812,7 +1812,7 @@ DEFUN (config_enable_password, else { vty_outln (vty, "Unknown encryption type."); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } @@ -1820,7 +1820,7 @@ DEFUN (config_enable_password, { vty_outln (vty, "Please specify string starting with alphanumeric"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (host.enable) @@ -2134,14 +2134,14 @@ set_log_file(struct vty *vty, const char *fname, int loglevel) if (getcwd (cwd, MAXPATHLEN) == NULL) { zlog_err ("config_log_file: Unable to alloc mem!"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if ( (p = XMALLOC (MTYPE_TMP, strlen (cwd) + strlen (fname) + 2)) == NULL) { zlog_err ("config_log_file: Unable to alloc mem!"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } sprintf (p, "%s/%s", cwd, fname); fullpath = p; @@ -2157,7 +2157,7 @@ set_log_file(struct vty *vty, const char *fname, int loglevel) if (!ret) { vty_out (vty, "can't open logfile %s\n", fname); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (host.logfile) @@ -2371,7 +2371,7 @@ cmd_banner_motd_file (const char *file) host.motdfile = XSTRDUP (MTYPE_HOST, file); } else - success = CMD_WARNING; + success = CMD_WARNING_CONFIG_FAILED; return success; } @@ -2390,7 +2390,7 @@ DEFUN (banner_motd_file, if (cmd == CMD_ERR_NO_FILE) vty_out (vty, "%s does not exist", filename); - else if (cmd == CMD_WARNING) + else if (cmd == CMD_WARNING_CONFIG_FAILED) vty_out (vty, "%s must be in %s", filename, SYSCONFDIR); return cmd; |
