Merge "Handle 403 error on creating trust"
This commit is contained in:
commit
c9de2d67e9
@ -16,6 +16,7 @@
|
|||||||
import datetime
|
import datetime
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
from keystoneclient import exceptions as identity_exc
|
||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import exceptions
|
from osc_lib import exceptions
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
@ -105,10 +106,13 @@ class CreateTrust(command.ShowOne):
|
|||||||
|
|
||||||
role_names = []
|
role_names = []
|
||||||
for role in parsed_args.role:
|
for role in parsed_args.role:
|
||||||
role_name = utils.find_resource(
|
try:
|
||||||
identity_client.roles,
|
role_name = utils.find_resource(
|
||||||
role,
|
identity_client.roles,
|
||||||
).name
|
role,
|
||||||
|
).name
|
||||||
|
except identity_exc.Forbidden:
|
||||||
|
role_name = role
|
||||||
role_names.append(role_name)
|
role_names.append(role_name)
|
||||||
|
|
||||||
expires_at = None
|
expires_at = None
|
||||||
|
6
releasenotes/notes/bug-1658582-80a76f6b0af0ca12.yaml
Normal file
6
releasenotes/notes/bug-1658582-80a76f6b0af0ca12.yaml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
fixes:
|
||||||
|
- |
|
||||||
|
Correctly handle non-admin in ``create trust`` command when looking
|
||||||
|
up role names.
|
||||||
|
[Bug `1658582 <https://bugs.launchpad.net/python-openstackclient/+bug/1658582>`_]
|
Loading…
Reference in New Issue
Block a user