diff roundup/admin.py @ 6393:51a1a9b0f567

- issue2551062: AddPermission doesn't validate property names. roundup-admin security stops output when it finds an invalid property. It used to try to print the rest of the security properties. So errors were lost in the output. If roundup-admin is run non-interactively it exits with status 1 so it can be used in a script to validate the properties schema.
author John Rouillard <rouilj@ieee.org>
date Thu, 06 May 2021 18:56:47 -0400
parents 95183d73ac64
children ff4ab763f47c
line wrap: on
line diff
--- a/roundup/admin.py	Wed Apr 28 16:43:15 2021 +0200
+++ b/roundup/admin.py	Thu May 06 18:56:47 2021 -0400
@@ -1567,6 +1567,7 @@
                                 bad_props.append(p)
                         if bad_props:
                             sys.stdout.write(_('\n  **Invalid properties for %(class)s: %(props)s\n\n') % {"class": permission.klass, "props": bad_props})
+                            return 1
                     else:
                         sys.stdout.write(_(' %(description)s (%(name)s for '
                                            '"%(klass)s" only)\n') % d)

Roundup Issue Tracker: http://roundup-tracker.org/