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:
@@ -143,7 +143,7 @@ if '5' in transformations:
|
|||||||
for section in acl.keys():
|
for section in acl.keys():
|
||||||
newsection = []
|
newsection = []
|
||||||
for option in acl[section]:
|
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':
|
if key == 'exclusiveGroupPermissions':
|
||||||
newsection.append('%s = %s' % (
|
newsection.append('%s = %s' % (
|
||||||
key, ' '.join(sorted(value.split()))))
|
key, ' '.join(sorted(value.split()))))
|
||||||
@@ -193,7 +193,7 @@ if '8' in transformations:
|
|||||||
newsection = []
|
newsection = []
|
||||||
for option in acl[section]:
|
for option in acl[section]:
|
||||||
newsection.append(option)
|
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':
|
if key == 'exclusiveGroupPermissions':
|
||||||
exclusives = value.split()
|
exclusives = value.split()
|
||||||
# It's safe for these to be duplicates since we de-dup later
|
# It's safe for these to be duplicates since we de-dup later
|
||||||
|
Reference in New Issue
Block a user