Skip to content

Commit 0f749ca

Browse files
author
yangweiwei
committed
Fix credentials in create, update and list.
Now, keystone has supported serverl auth method, like 'totp'. Before we use this method, we should create the credential first. And we need create it with type 'totp'. But now we cannot create credential with this method. Also, I think the type should not have constrains. We can create any type in keystone project. So, we should do these actions too. The type would be more which We cannot control. Change-Id: Ie0482da3133fb515e4bb8e45f8c54f509589cc5e Closes-bug: #1731848
1 parent 4742d4d commit 0f749ca

4 files changed

Lines changed: 13 additions & 23 deletions

File tree

doc/source/cli/command-objects/credential.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Create new credential
1919
2020
.. option:: --type <type>
2121

22-
New credential type: cert, ec2
22+
New credential type: cert, ec2, totp and so on
2323

2424
.. option:: --project <project>
2525

@@ -73,7 +73,7 @@ List credentials
7373
7474
.. option:: --type <type>
7575
76-
Filter credentials by type: cert, ec2
76+
Filter credentials by type: cert, ec2, totp and so on
7777
7878
credential set
7979
--------------
@@ -96,7 +96,7 @@ Set credential properties
9696
9797
.. option:: --type <type>
9898
99-
New credential type: cert, ec2
99+
New credential type: cert, ec2, totp and so on.
100100
101101
.. option:: --data <data>
102102

openstackclient/identity/v3/credential.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ def get_parser(self, prog_name):
4343
'--type',
4444
default="cert",
4545
metavar='<type>',
46-
choices=['ec2', 'cert'],
47-
help=_('New credential type: cert, ec2'),
46+
help=_('New credential type: cert, ec2, totp and so on'),
4847
)
4948
parser.add_argument(
5049
'data',
@@ -124,8 +123,7 @@ def get_parser(self, prog_name):
124123
parser.add_argument(
125124
'--type',
126125
metavar='<type>',
127-
choices=['ec2', 'cert'],
128-
help=_('Filter credentials by type: cert, ec2'),
126+
help=_('Filter credentials by type: cert, ec2, totp and so on'),
129127
)
130128
return parser
131129

@@ -173,9 +171,8 @@ def get_parser(self, prog_name):
173171
parser.add_argument(
174172
'--type',
175173
metavar='<type>',
176-
choices=['ec2', 'cert'],
177174
required=True,
178-
help=_('New credential type: cert, ec2'),
175+
help=_('New credential type: cert, ec2, totp and so on'),
179176
)
180177
parser.add_argument(
181178
'--data',

openstackclient/tests/unit/identity/v3/test_credential.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -124,20 +124,6 @@ def test_credential_create_with_options(self):
124124
self.assertEqual(self.columns, columns)
125125
self.assertEqual(self.data, data)
126126

127-
def test_credential_create_with_invalid_type(self):
128-
arglist = [
129-
self.credential.user_id,
130-
self.credential.blob,
131-
'--type', 'invalid_type',
132-
]
133-
verifylist = [
134-
('user', self.credential.user_id),
135-
('data', self.credential.blob),
136-
('type', 'invalid_type'),
137-
]
138-
self.assertRaises(utils.ParserException, self.check_parser,
139-
self.cmd, arglist, verifylist)
140-
141127

142128
class TestCredentialDelete(TestCredential):
143129

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
fixes:
3+
- |
4+
Remove the type value limit in credentials when do create,
5+
reset or list. Now 'totp' method is supported in keystone
6+
project and we could create credentials with 'totp' type.
7+
[Bug `1731848 <https://bugs.launchpad.net/bugs/1731848>`_]

0 commit comments

Comments
 (0)