# HG changeset patch # User John Rouillard # Date 1774286321 14400 # Node ID e8d1da6e3571e5bef15fdb757f6a8d68f5a1db7d # Parent 4d09c8046cdef49438af0cab10572b81a2ca057b bug: fix traceback in roundup-admin init with bad config values initialize accepts setting values for config.ini file settings. If they are not valid, you got a python traceback. ConfigurationError exceptions are now trapped. The admin.py's usageError_feedback method is used to inform the user. Also the feedback message now starts with a newline making it easier to read by separating it from command that caused the issue. diff -r 4d09c8046cde -r e8d1da6e3571 CHANGES.txt --- a/CHANGES.txt Sun Mar 22 22:40:11 2026 -0400 +++ b/CHANGES.txt Mon Mar 23 13:18:41 2026 -0400 @@ -57,7 +57,12 @@ - change the html templates so that the password is not required if the ``login_empty_passwords`` setting is enabled in ``config.ini``. Directions for your tracker are in upgrading.txt. (John Rouillard) - +- fix traceback displayed when roundup-admin install was used with + invalid settings for config.ini. It now reports the error and + provides the usage output. Also usage output starts with a newline + to provide a blank line between the command and the output to + improve readability. (John Rouillard) + Features: - add support for authorized changes. User can be prompted to enter diff -r 4d09c8046cde -r e8d1da6e3571 roundup/admin.py --- a/roundup/admin.py Sun Mar 22 22:40:11 2026 -0400 +++ b/roundup/admin.py Mon Mar 23 13:18:41 2026 -0400 @@ -39,6 +39,7 @@ from roundup.anypy.my_input import my_input from roundup.anypy.strings import repr_export from roundup.configuration import ( + ConfigurationError, CoreConfig, NoConfigError, Option, @@ -1488,7 +1489,10 @@ defns[k] = template_config[k] # install! - init.install(tracker_home, templates[template]['path'], settings=defns) + try: + init.install(tracker_home, templates[template]['path'], settings=defns) + except ConfigurationError as e: + raise UsageError(e) # Remove config_ini.ini file from tracker_home (not template dir). # Ignore file not found - not all templates have @@ -2350,7 +2354,7 @@ self.do_genconfig(args, update=True) def usageError_feedback(self, message, function): - print(_('Error: %s') % message) + print(_('\nError: %s') % message) print() print(function.__doc__) return 1