pespin submitted this change.

View Change

Approvals: fixeria: Looks good to me, but someone else must approve Jenkins Builder: Verified pespin: Looks good to me, approved
src/osmo_ss7_vty.c: Improve error formatting in 'update route' cmd

Change-Id: I4fd5b30093425f1831348282d3563467c889e27f
---
M src/osmo_ss7_vty.c
M tests/vty/osmo_stp_test.vty
2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c
index fb224d1..6d78c2e 100644
--- a/src/osmo_ss7_vty.c
+++ b/src/osmo_ss7_vty.c
@@ -364,18 +364,18 @@
unsigned int argind;

if (dpc < 0) {
- vty_out(vty, "Invalid point code (%s)%s", argv[0], VTY_NEWLINE);
+ vty_out(vty, "%% Invalid point code (%s)%s", argv[0], VTY_NEWLINE);
return CMD_WARNING;
}

if (mask < 0) {
- vty_out(vty, "Invalid point code (%s)%s", argv[1], VTY_NEWLINE);
+ vty_out(vty, "%% Invalid point code (%s)%s", argv[1], VTY_NEWLINE);
return CMD_WARNING;
}

rt = osmo_ss7_route_create(rtable, dpc, mask, ls_name);
if (!rt) {
- vty_out(vty, "cannot create route %s/%s to %s%s",
+ vty_out(vty, "%% Cannot create route %s/%s to %s%s",
argv[0], argv[1], argv[2], VTY_NEWLINE);
return CMD_WARNING;
}
@@ -394,6 +394,7 @@
return CMD_WARNING;
break; /* Parse values below */
default:
+ vty_out(vty, "%% Incomplete command (missing an argument?)%s", VTY_NEWLINE);
return CMD_WARNING;
}

diff --git a/tests/vty/osmo_stp_test.vty b/tests/vty/osmo_stp_test.vty
index 8aac9c1..b2f5270 100644
--- a/tests/vty/osmo_stp_test.vty
+++ b/tests/vty/osmo_stp_test.vty
@@ -621,3 +621,5 @@
...
route-table system
... !update route 3.2.1 7.255.7 linkset my-ass priority 5 qos-class 1
+OsmoSTP(config-cs7-rt)# update route 3.2.1 7.255.7 linkset my-ass priority
+% Incomplete command (missing an argument?)

To view, visit change 38350. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: merged
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: I4fd5b30093425f1831348282d3563467c889e27f
Gerrit-Change-Number: 38350
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>