2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-22 17:43:14 +00:00

Fix restoration of old confluent db

Old confluent DB may have None in role. This is no longer
allowed.  Restore such entries by coercing them to 'Administrator'
which is how old confluent treated such users.
This commit is contained in:
Jarrod Johnson 2023-01-12 08:38:55 -05:00
parent 03fcd3f568
commit feed125c86

View File

@ -1625,6 +1625,8 @@ class ConfigManager(object):
name = confluent.util.stringify(name)
if name in self._cfgstore['users']:
raise Exception("Duplicate username requested")
if role is None:
role = 'Administrator'
for candrole in _validroles:
if candrole.lower().startswith(role.lower()):
role = candrole