Whamcloud - gitweb
LU-10151 lnet: report better config error with lnetctl 20/29820/2
authorSonia <sonia.sharma@intel.com>
Fri, 27 Oct 2017 10:14:29 +0000 (03:14 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 9 Nov 2017 20:07:06 +0000 (20:07 +0000)
Configuring net or route currently reports generic
message on error. Adding specific error message for
the missing parameters.

With importing config from yaml file, specific
error messages help in finding the exact error.

Change-Id: I7d9bdeb2280f4548897d9958aab7d451b981e8bd
Signed-off-by: Sonia Sharma <sonia.sharma@intel.com>
Test-Parameters: trivial
Reviewed-on: https://review.whamcloud.com/29820
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Amir Shehata <amir.shehata@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Doug Oucharek <dougso@me.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lnet/utils/lnetconfig/liblnetconfig.c

index 969143b..2df6a36 100644 (file)
@@ -822,7 +822,7 @@ int lustre_lnet_config_route(char *nw, char *gw, int hops, int prio,
        if (nw == NULL || gw == NULL) {
                snprintf(err_str,
                         sizeof(err_str),
-                        "\"missing mandatory parameter(s): '%s'\"",
+                        "\"missing mandatory parameter in route config:'%s'\"",
                         (nw == NULL && gw == NULL) ? "network, gateway" :
                         (nw == NULL) ? "network" : "gateway");
                rc = LUSTRE_CFG_RC_MISSING_PARAM;
@@ -905,7 +905,7 @@ int lustre_lnet_del_route(char *nw, char *gw,
        if (nw == NULL || gw == NULL) {
                snprintf(err_str,
                         sizeof(err_str),
-                        "\"missing mandatory parameter(s): '%s'\"",
+                        "\"missing mandatory parameter in route delete: '%s'\"",
                         (nw == NULL && gw == NULL) ? "network, gateway" :
                         (nw == NULL) ? "network" : "gateway");
                rc = LUSTRE_CFG_RC_MISSING_PARAM;
@@ -1546,7 +1546,9 @@ int lustre_lnet_config_ni(struct lnet_dlc_network_descr *nw_descr,
            list_empty(&nw_descr->nw_intflist))) {
                snprintf(err_str,
                         sizeof(err_str),
-                        "\"missing mandatory parameters\"");
+                        "\"missing mandatory parameters in NI config: '%s'\"",
+                        (nw_descr == NULL) ? "network , interface" :
+                        (nw_descr->nw_id == 0) ? "network" : "interface");
                rc = LUSTRE_CFG_RC_MISSING_PARAM;
                goto out;
        }
@@ -1684,7 +1686,9 @@ int lustre_lnet_del_ni(struct lnet_dlc_network_descr *nw_descr,
            list_empty(&nw_descr->nw_intflist)) {
                snprintf(err_str,
                         sizeof(err_str),
-                        "\"missing mandatory parameter\"");
+                        "\"missing mandatory parameter in deleting NI: '%s'\"",
+                        (nw_descr == NULL) ? "network , interface" :
+                        (nw_descr->nw_id == 0) ? "network" : "interface");
                rc = LUSTRE_CFG_RC_MISSING_PARAM;
                goto out;
        }