]> git.puffer.fish Git - matthieu/frr.git/commitdiff
Revert "vtysh: fix searching commands in parent nodes"
authorDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 28 Apr 2020 14:46:22 +0000 (10:46 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 28 Apr 2020 17:20:37 +0000 (13:20 -0400)
This reverts commit d741915ecdcf8930ccb3bd23eec1da2f0d000483.

This is because it breaks this behavior:

router ospf6
  <commands>
!
int enp39s0
  <more commands>
!

This is a very legal set of commands and completely destroys the
ability to do this.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
lib/command.c
vtysh/vtysh.c

index d2145d9f5a03becf2282605bdf3c74b88cac31f9..d9ae28b43527e81fe60d729825f2872c08112b67 100644 (file)
@@ -1136,7 +1136,6 @@ int cmd_execute_command(vector vline, struct vty *vty,
                return saved_ret;
 
        if (ret != CMD_SUCCESS && ret != CMD_WARNING
-           && ret != CMD_ERR_AMBIGUOUS && ret != CMD_ERR_INCOMPLETE
            && ret != CMD_NOT_MY_INSTANCE && ret != CMD_WARNING_CONFIG_FAILED) {
                /* This assumes all nodes above CONFIG_NODE are childs of
                 * CONFIG_NODE */
@@ -1148,7 +1147,6 @@ int cmd_execute_command(vector vline, struct vty *vty,
                        ret = cmd_execute_command_real(vline, FILTER_RELAXED,
                                                       vty, cmd);
                        if (ret == CMD_SUCCESS || ret == CMD_WARNING
-                           || ret == CMD_ERR_AMBIGUOUS || ret == CMD_ERR_INCOMPLETE
                            || ret == CMD_NOT_MY_INSTANCE
                            || ret == CMD_WARNING_CONFIG_FAILED)
                                return ret;
@@ -1333,7 +1331,6 @@ int command_config_read_one_line(struct vty *vty,
        if (!(use_daemon && ret == CMD_SUCCESS_DAEMON)
            && !(!use_daemon && ret == CMD_ERR_NOTHING_TODO)
            && ret != CMD_SUCCESS && ret != CMD_WARNING
-           && ret != CMD_ERR_AMBIGUOUS && ret != CMD_ERR_INCOMPLETE
            && ret != CMD_NOT_MY_INSTANCE && ret != CMD_WARNING_CONFIG_FAILED
            && vty->node != CONFIG_NODE) {
                int saved_node = vty->node;
@@ -1342,7 +1339,6 @@ int command_config_read_one_line(struct vty *vty,
                while (!(use_daemon && ret == CMD_SUCCESS_DAEMON)
                       && !(!use_daemon && ret == CMD_ERR_NOTHING_TODO)
                       && ret != CMD_SUCCESS && ret != CMD_WARNING
-                      && ret != CMD_ERR_AMBIGUOUS && ret != CMD_ERR_INCOMPLETE
                       && vty->node > CONFIG_NODE) {
                        vty->node = node_parent(vty->node);
                        if (vty->xpath_index > 0)
index b7d35caa3975889b9f912ffab5df3d6ce063ef52..f98a3d648036da94f01ad91b5995589c1356995f 100644 (file)
@@ -492,7 +492,6 @@ static int vtysh_execute_func(const char *line, int pager)
         */
        while (ret != CMD_SUCCESS && ret != CMD_SUCCESS_DAEMON
               && ret != CMD_WARNING && ret != CMD_WARNING_CONFIG_FAILED
-              && ret != CMD_ERR_AMBIGUOUS && ret != CMD_ERR_INCOMPLETE
               && vty->node > CONFIG_NODE) {
                vty->node = node_parent(vty->node);
                ret = cmd_execute(vty, line, &cmd, 1);
@@ -778,7 +777,6 @@ int vtysh_mark_file(const char *filename)
                 */
                while (ret != CMD_SUCCESS && ret != CMD_SUCCESS_DAEMON
                       && ret != CMD_WARNING && ret != CMD_WARNING_CONFIG_FAILED
-                      && ret != CMD_ERR_AMBIGUOUS && ret != CMD_ERR_INCOMPLETE
                       && vty->node > CONFIG_NODE) {
                        vty->node = node_parent(vty->node);
                        ret = cmd_execute_command_strict(vline, vty, &cmd);