Merge "Remove use of formatter function"

This commit is contained in:
Zuul
2025-04-02 10:19:34 +00:00
committed by Gerrit Code Review

View File

@@ -428,24 +428,23 @@ class ListRole(command.Lister):
domain = identity_client.find_domain( domain = identity_client.find_domain(
name_or_id=parsed_args.domain, name_or_id=parsed_args.domain,
) )
columns: tuple[str, ...] = ('ID', 'Name', 'Domain')
data = identity_client.roles(domain_id=domain.id) data = identity_client.roles(domain_id=domain.id)
else:
columns = ('ID', 'Name')
data = identity_client.roles()
return ( return (
columns, ('ID', 'Name', 'Domain'),
( (
utils.get_item_properties( utils.get_item_properties(s, ('id', 'name'))
s, + (domain.name,)
columns,
formatters={'Domain': lambda _: domain.name},
)
for s in data for s in data
), ),
) )
else:
data = identity_client.roles()
return (
('ID', 'Name'),
(utils.get_item_properties(s, ('id', 'name')) for s in data),
)
class RemoveRole(command.Command): class RemoveRole(command.Command):
_description = _( _description = _(