]> git.puffer.fish Git - matthieu/frr.git/commitdiff
vtysh: Allow file read in to continue in more cases
authorDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 15 Apr 2016 13:15:21 +0000 (09:15 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 15 Apr 2016 19:13:13 +0000 (15:13 -0400)
When a duplicate command is read in from a file,
there are cases where daemons return CMD_WARNING
this causes the command to not be send to subsuquent
daemons( if any ).

Allow the read in of commands to continue in this
situation.

Ticket: CM-10393
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
vtysh/vtysh.c

index f7f38049ebc219eb40a7f1c7cbf2c8c0afd49685..44d67e8f9d4b9b4a18c0a3133b903e7c38656be4 100644 (file)
@@ -723,7 +723,15 @@ vtysh_config_from_file (struct vty *vty, FILE *fp)
                  {
                    cmd_stat = vtysh_client_execute (&vtysh_client[i],
                                                     vty->buf, stdout);
-                   if (cmd_stat != CMD_SUCCESS)
+                   /*
+                    * CMD_WARNING - Can mean that the command was
+                    * parsed successfully but it was already entered
+                    * in a few spots.  As such if we receive a
+                    * CMD_WARNING from a daemon we shouldn't stop
+                    * talking to the other daemons for the particular
+                    * command.
+                    */
+                   if (cmd_stat != CMD_SUCCESS && cmd_stat != CMD_WARNING)
                       {
                         fprintf (stderr, "line %d: Failure to communicate[%d] to %s, line: %s\n",
                                  lineno, cmd_stat, vtysh_client[i].name, vty->buf);