summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2017-12-11 22:45:54 +0000
committerGerrit Code Review <review@openstack.org>2017-12-11 22:45:54 +0000
commit58e5abf2946ce9f0fa118866ac89f6ce881e440e (patch)
tree9b14fe77936fff2bc0ebf0c742f2f0e7ee2d39a5
parent1d914dd9ad9cb9e5d7bba2dab50d9e292c149842 (diff)
parent0f749cacc2b0a76226a6a7ab7769ecf1475a160b (diff)
downloadpython-openstackclient-58e5abf2946ce9f0fa118866ac89f6ce881e440e.tar.gz
Merge "Fix credentials in create, update and list."
-rw-r--r--doc/source/cli/command-objects/credential.rst6
-rw-r--r--openstackclient/identity/v3/credential.py9
-rw-r--r--openstackclient/tests/unit/identity/v3/test_credential.py14
-rw-r--r--releasenotes/notes/bug-1731848-71d0a5fdb1a34a8b.yaml7
4 files changed, 13 insertions, 23 deletions
diff --git a/doc/source/cli/command-objects/credential.rst b/doc/source/cli/command-objects/credential.rst
index 47c847c8..7fe57310 100644
--- a/doc/source/cli/command-objects/credential.rst
+++ b/doc/source/cli/command-objects/credential.rst
@@ -19,7 +19,7 @@ Create new credential
.. option:: --type <type>
- New credential type: cert, ec2
+ New credential type: cert, ec2, totp and so on
.. option:: --project <project>
@@ -73,7 +73,7 @@ List credentials
.. option:: --type <type>
- Filter credentials by type: cert, ec2
+ Filter credentials by type: cert, ec2, totp and so on
credential set
--------------
@@ -96,7 +96,7 @@ Set credential properties
.. option:: --type <type>
- New credential type: cert, ec2
+ New credential type: cert, ec2, totp and so on.
.. option:: --data <data>
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):
diff --git a/releasenotes/notes/bug-1731848-71d0a5fdb1a34a8b.yaml b/releasenotes/notes/bug-1731848-71d0a5fdb1a34a8b.yaml
new file mode 100644
index 00000000..e3665273
--- /dev/null
+++ b/releasenotes/notes/bug-1731848-71d0a5fdb1a34a8b.yaml
@@ -0,0 +1,7 @@
+---
+fixes:
+ - |
+ Remove the type value limit in credentials when do create,
+ reset or list. Now 'totp' method is supported in keystone
+ project and we could create credentials with 'totp' type.
+ [Bug `1731848 <https://bugs.launchpad.net/bugs/1731848>`_]