File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -401,6 +401,11 @@ several `FSD` notifications into one executed action. [PR #3097]
401401
402402 - `upsc` has now optional JSON output [issue #3172, PR #3178]
403403
404+ - `upscmd` and `upsrw` clients would now report that the "OK" response only
405+ means that the server accepted the query, if wait mode ("TRACKING") was
406+ not specified, and what users could do about it (e.g. use the `-w` option
407+ or `export NUT_QUIET_OK_NOTRACKING=true` to hide the warning). [issue #3383]
408+
404409 - `upsset` CGI tool should now recognize `RANGE NUMBER` and `NUMBER` types.
405410 [#3164]
406411
Original file line number Diff line number Diff line change @@ -211,11 +211,19 @@ static void do_cmd(char **argv, const int argc)
211211 /* sanity check on the size: "OK TRACKING " + UUID4_LEN */
212212 strlen (buf ) != (UUID4_LEN - 1 + strlen ("OK TRACKING " ))
213213 ) {
214+ char * e = getenv ("NUT_QUIET_OK_NOTRACKING" );
215+ int lvl = 0 ; /* Visible by default */
216+
217+ if (e && !strcmp (e , "true" ))
218+ lvl = 1 ; /* Hide into debuging if asked to */
219+
214220 /* reply as usual */
215221 fprintf (stderr , "%s\n" , buf );
216- upsdebugx (1 , "%s: 'OK' only means the NUT data server accepted the request as valid, "
217- "but as we did not wait for result, we do not know if it was handled in fact." ,
218- __func__ );
222+ upsdebugx (lvl , "%s: 'OK' only means the NUT data server accepted the request as valid, "
223+ "but as we did not wait for result, we do not know if it was handled in fact.%s" ,
224+ lvl ? __func__ : "WARNING" ,
225+ lvl ? "" : " You can export NUT_QUIET_OK_NOTRACKING=true to hide this message, or use -w (-t SEC) option(s) to track the actual outcome."
226+ );
219227 return ;
220228 }
221229
Original file line number Diff line number Diff line change @@ -141,11 +141,19 @@ static void do_set(const char *varname, const char *newval)
141141 /* sanity check on the size: "OK TRACKING " + UUID4_LEN */
142142 strlen (buf ) != (UUID4_LEN - 1 + strlen ("OK TRACKING " ))
143143 ) {
144+ char * e = getenv ("NUT_QUIET_OK_NOTRACKING" );
145+ int lvl = 0 ; /* Visible by default */
146+
147+ if (e && !strcmp (e , "true" ))
148+ lvl = 1 ; /* Hide into debuging if asked to */
149+
144150 /* reply as usual */
145151 fprintf (stderr , "%s\n" , buf );
146- upsdebugx (1 , "%s: 'OK' only means the NUT data server accepted the request as valid, "
147- "but as we did not wait for result, we do not know if it was handled in fact." ,
148- __func__ );
152+ upsdebugx (lvl , "%s: 'OK' only means the NUT data server accepted the request as valid, "
153+ "but as we did not wait for result, we do not know if it was handled in fact.%s" ,
154+ lvl ? __func__ : "WARNING" ,
155+ lvl ? "" : " You can export NUT_QUIET_OK_NOTRACKING=true to hide this message, or use -w (-t SEC) option(s) to track the actual outcome."
156+ );
149157 return ;
150158 }
151159
Original file line number Diff line number Diff line change 1- personal_ws-1.1 en 3727 utf-8
1+ personal_ws-1.1 en 3728 utf-8
22AAC
33AAS
44ABI
@@ -835,6 +835,7 @@ NOTIFYMSG
835835NOTOFF
836836NOTOTHER
837837NOTOVER
838+ NOTRACKING
838839NOTTRIM
839840NQA
840841NTFS
You can’t perform that action at this time.
0 commit comments