Ensure show on absent appcreds raises exception
Currently, running ``application credential show`` on a
non-existent appcred will exit normally and display a
formatted application credential with no data, despite
the Keystone API returning a 404.
Ensure that querying a non-existent application
credential raises an exception message and an exit-code
1 to the user.
Closes-Bug: #2126565
Change-Id: I597d2d4064f1020c5ac40862ecc556f3c94b53eb
Signed-off-by: Matt Anson <matta@stackhpc.com>
(cherry picked from commit fb8cdd4441)
This commit is contained in:
committed by
Stephen Finucane
parent
a122400b90
commit
9916aa6bc1
@@ -352,7 +352,7 @@ class ShowApplicationCredential(command.ShowOne):
|
||||
user_id = conn.config.get_auth().get_user_id(conn.identity)
|
||||
|
||||
application_credential = identity_client.find_application_credential(
|
||||
user_id, parsed_args.application_credential
|
||||
user_id, parsed_args.application_credential, ignore_missing=False
|
||||
)
|
||||
|
||||
return _format_application_credential(application_credential)
|
||||
|
||||
@@ -457,7 +457,7 @@ class TestApplicationCredentialShow(identity_fakes.TestIdentityv3):
|
||||
columns, data = self.cmd.take_action(parsed_args)
|
||||
|
||||
self.identity_sdk_client.find_application_credential.assert_called_with(
|
||||
user_id, self.application_credential.id
|
||||
user_id, self.application_credential.id, ignore_missing=False
|
||||
)
|
||||
|
||||
self.assertEqual(self.columns, columns)
|
||||
|
||||
8
releasenotes/notes/bug-2126565-a119ac242d9ac795.yaml
Normal file
8
releasenotes/notes/bug-2126565-a119ac242d9ac795.yaml
Normal file
@@ -0,0 +1,8 @@
|
||||
---
|
||||
fixes:
|
||||
- |
|
||||
Running ``openstack application credential show`` on
|
||||
a non-existent application credential does not
|
||||
raise an exception.
|
||||
|
||||
[Bug `2126565 <https://bugs.launchpad.net/python-openstackclient/+bug/2126565>`_]
|
||||
Reference in New Issue
Block a user