Rename --no_cache to --os_cache.

Some changes to make keystoneclient more backwards compatible
by disabling key caching by default.

This patch renames the CLI option for when to use the
auth token cache to --os-cache and sets it to False by default.

It also changes the ENV variable to OS_CACHE (instead of OS_NO_CACHE).

Change-Id: I6e549feec6ee7500e398a1eceb5bb44cd7d40347
This commit is contained in:
Dan Prince
2012-12-06 15:24:47 -05:00
parent 1bff1909df
commit d734821c99
2 changed files with 8 additions and 9 deletions

View File

@@ -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)

View File

@@ -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)