vtysh: handle case if there is no match in "write terminal $daemon"

While the DEFUN should match the list of clients registered in
vtysh, it seems better to handle the case explicitly instead of
relying on the client list and the DEFUN signature being in sync.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
Christian Franke 2016-06-14 20:07:09 +02:00 committed by Donald Sharp
parent 58093a7917
commit ce01a2ca3f

View File

@ -2409,6 +2409,9 @@ DEFUN (vtysh_write_terminal_daemon,
break;
}
if (i == array_size(vtysh_client))
return CMD_ERR_NO_MATCH;
ret = vtysh_client_execute(&vtysh_client[i], "show running-config\n", stdout);
return ret;