gerrit/acl : handle key / values with multiple =

For things like submit-requirements, we have fields like submittableIf
which take a query string that may have "=" on the LHS.  Change the
key/value split so that it only takes the key up to the first "=".

Change-Id: Iada801bd1c38dd1e0502bebefd6a1421c746c90a
This commit is contained in:
Ian Wienand 2023-03-02 11:09:40 +11:00
parent 69c2976cab
commit f73a678945
No known key found for this signature in database
1 changed files with 2 additions and 2 deletions

View File

@ -143,7 +143,7 @@ if '5' in transformations:
for section in acl.keys():
newsection = []
for option in acl[section]:
key, value = [x.strip() for x in option.split('=')]
key, value = [x.strip() for x in option.split('=', 1)]
if key == 'exclusiveGroupPermissions':
newsection.append('%s = %s' % (
key, ' '.join(sorted(value.split()))))
@ -193,7 +193,7 @@ if '8' in transformations:
newsection = []
for option in acl[section]:
newsection.append(option)
key, value = [x.strip() for x in option.split('=')]
key, value = [x.strip() for x in option.split('=', 1)]
if key == 'exclusiveGroupPermissions':
exclusives = value.split()
# It's safe for these to be duplicates since we de-dup later