Univention Bugzilla – Bug 42955
StringSanitizer should allow a error message
Last modified: 2019-06-26 12:14:12 CEST
Created attachment 8221 [details] Screenshot A regular expression can be given to StringSanitizer. StringSanitizer currently only tells that the "Value is invalid". This is not helpful. If one could overwrite this error message via another parameter it could show a user friendly message. I had to support some of our colleagues twice because the UCS@school installer shows this error message when the DC Slave hostname doesn't match a specific regex. They only needed this information. See attached Screenshot.
And even nicer would be if one could add a label for the field. Otherwise the error message always contains the internal name.
This issue has been filled against UCS 4.1. The maintenance with bug and security fixes for UCS 4.1 has ended on 5st of April 2018. Customers still on UCS 4.1 are encouraged to update to UCS 4.3. Please contact your partner or Univention for any questions. If this issue still occurs in newer UCS versions, please use "Clone this bug" or simply reopen the issue. In this case please provide detailed information on how this issue is affecting you.
As customer is affected switching to "Bug report" instead of "Development internal". Customer trying to configure ucsschool wizard: 25.03.19 14:33:11.098 MAIN ( PROCESS ) : CPCommand (192.168.1.2:48484) response status code: 422 25.03.19 14:33:11.098 MAIN ( PROCESS ) : CPCommand (192.168.1.2:48484) response message: 1 Fehler aufgetreten 25.03.19 14:33:11.099 MAIN ( PROCESS ) : CPCommand (192.168.1.2:48484) response result: {'master': u'Wert ist ung\xfcltig'} 25.03.19 14:33:11.099 MAIN ( PROCESS ) : CPCommand (192.168.1.2:48484) response error: {'traceback': None, 'command': 'install'} 25.03.19 14:35:30.324 DEBUG_INIT
If this is added we should change in UCS@school: ucsschool/ucs-school-umc-installer/umc/python/schoolinstaller/__init__.py Every sanititer could have a meaningfull message like: "The hostname of a UCS@school Domaincontroller must be ..."
The fix is probably a bit tricky because the sanitizer arguments are evaluated at import time. Therefore the _() translation is fixed. But as the locale is already set this should work for UMC module processes. Nice is, that the sanitizers already accept all keyword arguments, so there will no package dependencies and UCS@school modules and the fix can be released independently.