Merge "fix(federation): follow-up"

This commit is contained in:
Zuul 2024-01-19 16:51:41 +00:00 committed by Gerrit Code Review
commit 21cc759c22
1 changed files with 4 additions and 10 deletions

View File

@ -562,22 +562,16 @@ class RuleProcessor(object):
LOG.debug('mapped_properties: %s', mapped_properties)
return mapped_properties
def _ast_literal_eval(self, value):
# This is a workaround for the fact that ast.literal_eval handles the
# case of either a string or a list of strings, but not a potential
# list of ints.
@staticmethod
def _ast_literal_eval(value):
try:
values = ast.literal_eval(value)
# NOTE(mnaser): It's possible that the group_names_list is a
# numerical value which would successfully parse
# and not raise an exception, so we forcefully
# raise is here.
# We expect a list here, but literal_eval will successfully
# parse and return a single value. We raise ValueError if so.
if not isinstance(values, list):
raise ValueError
except (ValueError, SyntaxError):
values = [value]
return values
def _normalize_groups(self, identity_value):