diff --git a/keystoneclient/shell.py b/keystoneclient/shell.py index 9d9ed386e..92b30eec0 100644 --- a/keystoneclient/shell.py +++ b/keystoneclient/shell.py @@ -180,13 +180,12 @@ class OpenStackIdentityShell(object): 'against any certificate authorities. This ' 'option should be used with caution.') - parser.add_argument('--no-cache', - default=env('OS_NO_CACHE', - default=False), + parser.add_argument('--os-cache', + default=env('OS_CACHE', default=False), action='store_true', - help='Don\'t use the auth token cache. ' - 'Default to env[OS_NO_CACHE]') - parser.add_argument('--no_cache', + help='Use the auth token cache. ' + 'Default to env[OS_CACHE]') + parser.add_argument('--os_cache', help=argparse.SUPPRESS) parser.add_argument('--force-new-token', @@ -409,7 +408,7 @@ class OpenStackIdentityShell(object): cert=args.os_cert, insecure=args.insecure, debug=args.debug, - use_keyring=(not args.no_cache), + use_keyring=args.os_cache, force_new_token=args.force_new_token, stale_duration=args.stale_duration) diff --git a/tests/test_shell.py b/tests/test_shell.py index 2d2e3bfc3..a9e0b795f 100644 --- a/tests/test_shell.py +++ b/tests/test_shell.py @@ -94,14 +94,14 @@ class ShellTest(utils.TestCase): '--os-tenant-id 4321 --os-tenant-name wilma ' '--os-username betty ' '--os-identity-api-version 2.0 ' - '--no-cache ' + '--os-cache ' '--stale-duration 500 ' '--force-new-token user-list') assert do_tenant_mock.called ((a, b), c) = do_tenant_mock.call_args actual = (b.os_auth_url, b.os_password, b.os_tenant_id, b.os_tenant_name, b.os_username, - b.os_identity_api_version, b.no_cache, + b.os_identity_api_version, b.os_cache, b.stale_duration, b.force_new_token) expect = ('http://1.1.1.1:5000/', 'xyzpdq', '4321', 'wilma', 'betty', '2.0', True, '500', True)