diff options
| author | yangweiwei <yangweiwei@cmss.chinamobile.com> | 2017-11-17 11:39:15 +0800 |
|---|---|---|
| committer | yangweiwei <yangweiwei@cmss.chinamobile.com> | 2017-11-17 11:39:15 +0800 |
| commit | 0f749cacc2b0a76226a6a7ab7769ecf1475a160b (patch) | |
| tree | 37ecbfb863b416606c2c18efa29bd47006eb051e /openstackclient | |
| parent | 4742d4df7089cd10d03635a1b3dbca9e7e80b1cc (diff) | |
| download | python-openstackclient-0f749cacc2b0a76226a6a7ab7769ecf1475a160b.tar.gz | |
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
Diffstat (limited to 'openstackclient')
| -rw-r--r-- | openstackclient/identity/v3/credential.py | 9 | ||||
| -rw-r--r-- | openstackclient/tests/unit/identity/v3/test_credential.py | 14 |
2 files changed, 3 insertions, 20 deletions
diff --git a/openstackclient/identity/v3/credential.py b/openstackclient/identity/v3/credential.py index 79ef632c..981f940a 100644 --- a/openstackclient/identity/v3/credential.py +++ b/openstackclient/identity/v3/credential.py @@ -43,8 +43,7 @@ class CreateCredential(command.ShowOne): '--type', default="cert", metavar='<type>', - choices=['ec2', 'cert'], - help=_('New credential type: cert, ec2'), + help=_('New credential type: cert, ec2, totp and so on'), ) parser.add_argument( 'data', @@ -124,8 +123,7 @@ class ListCredential(command.Lister): parser.add_argument( '--type', metavar='<type>', - choices=['ec2', 'cert'], - help=_('Filter credentials by type: cert, ec2'), + help=_('Filter credentials by type: cert, ec2, totp and so on'), ) return parser @@ -173,9 +171,8 @@ class SetCredential(command.Command): parser.add_argument( '--type', metavar='<type>', - choices=['ec2', 'cert'], required=True, - help=_('New credential type: cert, ec2'), + help=_('New credential type: cert, ec2, totp and so on'), ) parser.add_argument( '--data', diff --git a/openstackclient/tests/unit/identity/v3/test_credential.py b/openstackclient/tests/unit/identity/v3/test_credential.py index 161f0484..de0306dd 100644 --- a/openstackclient/tests/unit/identity/v3/test_credential.py +++ b/openstackclient/tests/unit/identity/v3/test_credential.py @@ -124,20 +124,6 @@ class TestCredentialCreate(TestCredential): self.assertEqual(self.columns, columns) self.assertEqual(self.data, data) - def test_credential_create_with_invalid_type(self): - arglist = [ - self.credential.user_id, - self.credential.blob, - '--type', 'invalid_type', - ] - verifylist = [ - ('user', self.credential.user_id), - ('data', self.credential.blob), - ('type', 'invalid_type'), - ] - self.assertRaises(utils.ParserException, self.check_parser, - self.cmd, arglist, verifylist) - class TestCredentialDelete(TestCredential): |
