mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-12 05:34:41 +00:00
Merge pull request #5083 from zays26/feature/vtysh-master
vtysh: fix searching commands in parent nodes
This commit is contained in:
commit
890b7a3c77
@ -1135,6 +1135,7 @@ int cmd_execute_command(vector vline, struct vty *vty,
|
|||||||
return saved_ret;
|
return saved_ret;
|
||||||
|
|
||||||
if (ret != CMD_SUCCESS && ret != CMD_WARNING
|
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) {
|
&& ret != CMD_NOT_MY_INSTANCE && ret != CMD_WARNING_CONFIG_FAILED) {
|
||||||
/* This assumes all nodes above CONFIG_NODE are childs of
|
/* This assumes all nodes above CONFIG_NODE are childs of
|
||||||
* CONFIG_NODE */
|
* CONFIG_NODE */
|
||||||
@ -1146,6 +1147,7 @@ int cmd_execute_command(vector vline, struct vty *vty,
|
|||||||
ret = cmd_execute_command_real(vline, FILTER_RELAXED,
|
ret = cmd_execute_command_real(vline, FILTER_RELAXED,
|
||||||
vty, cmd);
|
vty, cmd);
|
||||||
if (ret == CMD_SUCCESS || ret == CMD_WARNING
|
if (ret == CMD_SUCCESS || ret == CMD_WARNING
|
||||||
|
|| ret == CMD_ERR_AMBIGUOUS || ret == CMD_ERR_INCOMPLETE
|
||||||
|| ret == CMD_NOT_MY_INSTANCE
|
|| ret == CMD_NOT_MY_INSTANCE
|
||||||
|| ret == CMD_WARNING_CONFIG_FAILED)
|
|| ret == CMD_WARNING_CONFIG_FAILED)
|
||||||
return ret;
|
return ret;
|
||||||
@ -1330,6 +1332,7 @@ int command_config_read_one_line(struct vty *vty,
|
|||||||
if (!(use_daemon && ret == CMD_SUCCESS_DAEMON)
|
if (!(use_daemon && ret == CMD_SUCCESS_DAEMON)
|
||||||
&& !(!use_daemon && ret == CMD_ERR_NOTHING_TODO)
|
&& !(!use_daemon && ret == CMD_ERR_NOTHING_TODO)
|
||||||
&& ret != CMD_SUCCESS && ret != CMD_WARNING
|
&& ret != CMD_SUCCESS && ret != CMD_WARNING
|
||||||
|
&& ret != CMD_ERR_AMBIGUOUS && ret != CMD_ERR_INCOMPLETE
|
||||||
&& ret != CMD_NOT_MY_INSTANCE && ret != CMD_WARNING_CONFIG_FAILED
|
&& ret != CMD_NOT_MY_INSTANCE && ret != CMD_WARNING_CONFIG_FAILED
|
||||||
&& vty->node != CONFIG_NODE) {
|
&& vty->node != CONFIG_NODE) {
|
||||||
int saved_node = vty->node;
|
int saved_node = vty->node;
|
||||||
@ -1338,6 +1341,7 @@ int command_config_read_one_line(struct vty *vty,
|
|||||||
while (!(use_daemon && ret == CMD_SUCCESS_DAEMON)
|
while (!(use_daemon && ret == CMD_SUCCESS_DAEMON)
|
||||||
&& !(!use_daemon && ret == CMD_ERR_NOTHING_TODO)
|
&& !(!use_daemon && ret == CMD_ERR_NOTHING_TODO)
|
||||||
&& ret != CMD_SUCCESS && ret != CMD_WARNING
|
&& ret != CMD_SUCCESS && ret != CMD_WARNING
|
||||||
|
&& ret != CMD_ERR_AMBIGUOUS && ret != CMD_ERR_INCOMPLETE
|
||||||
&& vty->node > CONFIG_NODE) {
|
&& vty->node > CONFIG_NODE) {
|
||||||
vty->node = node_parent(vty->node);
|
vty->node = node_parent(vty->node);
|
||||||
if (vty->xpath_index > 0)
|
if (vty->xpath_index > 0)
|
||||||
|
@ -492,6 +492,7 @@ static int vtysh_execute_func(const char *line, int pager)
|
|||||||
*/
|
*/
|
||||||
while (ret != CMD_SUCCESS && ret != CMD_SUCCESS_DAEMON
|
while (ret != CMD_SUCCESS && ret != CMD_SUCCESS_DAEMON
|
||||||
&& ret != CMD_WARNING && ret != CMD_WARNING_CONFIG_FAILED
|
&& ret != CMD_WARNING && ret != CMD_WARNING_CONFIG_FAILED
|
||||||
|
&& ret != CMD_ERR_AMBIGUOUS && ret != CMD_ERR_INCOMPLETE
|
||||||
&& vty->node > CONFIG_NODE) {
|
&& vty->node > CONFIG_NODE) {
|
||||||
vty->node = node_parent(vty->node);
|
vty->node = node_parent(vty->node);
|
||||||
ret = cmd_execute(vty, line, &cmd, 1);
|
ret = cmd_execute(vty, line, &cmd, 1);
|
||||||
@ -777,6 +778,7 @@ int vtysh_mark_file(const char *filename)
|
|||||||
*/
|
*/
|
||||||
while (ret != CMD_SUCCESS && ret != CMD_SUCCESS_DAEMON
|
while (ret != CMD_SUCCESS && ret != CMD_SUCCESS_DAEMON
|
||||||
&& ret != CMD_WARNING && ret != CMD_WARNING_CONFIG_FAILED
|
&& ret != CMD_WARNING && ret != CMD_WARNING_CONFIG_FAILED
|
||||||
|
&& ret != CMD_ERR_AMBIGUOUS && ret != CMD_ERR_INCOMPLETE
|
||||||
&& vty->node > CONFIG_NODE) {
|
&& vty->node > CONFIG_NODE) {
|
||||||
vty->node = node_parent(vty->node);
|
vty->node = node_parent(vty->node);
|
||||||
ret = cmd_execute_command_strict(vline, vty, &cmd);
|
ret = cmd_execute_command_strict(vline, vty, &cmd);
|
||||||
|
Loading…
Reference in New Issue
Block a user