comparison 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
comparison
equal deleted inserted replaced
6392:99455aeec1ae 6393:51a1a9b0f567
1565 continue 1565 continue
1566 else: 1566 else:
1567 bad_props.append(p) 1567 bad_props.append(p)
1568 if bad_props: 1568 if bad_props:
1569 sys.stdout.write(_('\n **Invalid properties for %(class)s: %(props)s\n\n') % {"class": permission.klass, "props": bad_props}) 1569 sys.stdout.write(_('\n **Invalid properties for %(class)s: %(props)s\n\n') % {"class": permission.klass, "props": bad_props})
1570 return 1
1570 else: 1571 else:
1571 sys.stdout.write(_(' %(description)s (%(name)s for ' 1572 sys.stdout.write(_(' %(description)s (%(name)s for '
1572 '"%(klass)s" only)\n') % d) 1573 '"%(klass)s" only)\n') % d)
1573 else: 1574 else:
1574 sys.stdout.write(_(' %(description)s (%(name)s)\n') % d) 1575 sys.stdout.write(_(' %(description)s (%(name)s)\n') % d)

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