diff options
author | Jamie Lennox <jlennox@redhat.com> | 2013-05-03 14:04:09 +1000 |
---|---|---|
committer | Jamie Lennox <jlennox@redhat.com> | 2013-05-21 10:14:12 +1000 |
commit | ff76a1b5cd3308cfb0ce936800364e27413ed946 (patch) | |
tree | 537b430171ca5405eed0ba7b0e2f7ce98ab15315 /keystone/cli.py | |
parent | 8d2b8e6457d5ae0ed1136091cb8c143a96abd614 (diff) | |
download | keystone-ff76a1b5cd3308cfb0ce936800364e27413ed946.tar.gz keystone-ff76a1b5cd3308cfb0ce936800364e27413ed946.tar.xz keystone-ff76a1b5cd3308cfb0ce936800364e27413ed946.zip |
Implement Token Flush via keystone-manage.
Creates a cli entry 'token_flush' which removes all expired tokens.
Fixes: bug 1032633
Implements: blueprint keystone-manage-token-flush
Change-Id: I47eab99b577ff9e9ee74fee08e18fd07c4af5aad
Diffstat (limited to 'keystone/cli.py')
-rw-r--r-- | keystone/cli.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/keystone/cli.py b/keystone/cli.py index b635878e..dfa38c7f 100644 --- a/keystone/cli.py +++ b/keystone/cli.py @@ -26,6 +26,7 @@ from keystone import config from keystone.openstack.common import importutils from keystone.openstack.common import jsonutils from keystone.openstack.common import version +from keystone import token CONF = config.CONF @@ -111,6 +112,17 @@ class SSLSetup(BaseCertificateSetup): conf_ssl.run() +class TokenFlush(BaseApp): + """Flush expired tokens from the backend.""" + + name = 'token_flush' + + @classmethod + def main(cls): + token_manager = token.Manager() + token_manager.driver.flush_expired_tokens() + + class ImportLegacy(BaseApp): """Import a legacy database.""" @@ -173,6 +185,7 @@ CMDS = [ ImportNovaAuth, PKISetup, SSLSetup, + TokenFlush, ] |