[MERGED] osmo-hlr[master]: vty: Don't print error if removing auth data while none present

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Thu Mar 1 20:38:01 UTC 2018


Harald Welte has submitted this change and it was merged.

Change subject: vty: Don't print error if removing auth data while none present
......................................................................


vty: Don't print error if removing auth data while none present

It's a bit confusing to the user if he wants to set AUD=none
and it's already none.  Avoid printing error messages in that case.

Change-Id: I5f32dd5d6e4939c738faf442c7e86671d18777f8
---
M src/hlr_vty_subscr.c
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/hlr_vty_subscr.c b/src/hlr_vty_subscr.c
index 5a300a7..7191a1c 100644
--- a/src/hlr_vty_subscr.c
+++ b/src/hlr_vty_subscr.c
@@ -334,7 +334,7 @@
 
 	rc = db_subscr_update_aud_by_id(g_hlr->dbc, subscr.id, &aud);
 
-	if (rc) {
+	if (rc && rc != -ENOENT) {
 		vty_out(vty, "%% Error: cannot disable 2G auth data for IMSI='%s'%s",
 			subscr.imsi, VTY_NEWLINE);
 		return CMD_WARNING;
@@ -405,7 +405,7 @@
 
 	rc = db_subscr_update_aud_by_id(g_hlr->dbc, subscr.id, &aud);
 
-	if (rc) {
+	if (rc && rc != -ENOENT) {
 		vty_out(vty, "%% Error: cannot disable 3G auth data for IMSI='%s'%s",
 			subscr.imsi, VTY_NEWLINE);
 		return CMD_WARNING;

-- 
To view, visit https://gerrit.osmocom.org/7037
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I5f32dd5d6e4939c738faf442c7e86671d18777f8
Gerrit-PatchSet: 1
Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list