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:
@@ -180,13 +180,12 @@ class OpenStackIdentityShell(object):
|
|||||||
'against any certificate authorities. This '
|
'against any certificate authorities. This '
|
||||||
'option should be used with caution.')
|
'option should be used with caution.')
|
||||||
|
|
||||||
parser.add_argument('--no-cache',
|
parser.add_argument('--os-cache',
|
||||||
default=env('OS_NO_CACHE',
|
default=env('OS_CACHE', default=False),
|
||||||
default=False),
|
|
||||||
action='store_true',
|
action='store_true',
|
||||||
help='Don\'t use the auth token cache. '
|
help='Use the auth token cache. '
|
||||||
'Default to env[OS_NO_CACHE]')
|
'Default to env[OS_CACHE]')
|
||||||
parser.add_argument('--no_cache',
|
parser.add_argument('--os_cache',
|
||||||
help=argparse.SUPPRESS)
|
help=argparse.SUPPRESS)
|
||||||
|
|
||||||
parser.add_argument('--force-new-token',
|
parser.add_argument('--force-new-token',
|
||||||
@@ -409,7 +408,7 @@ class OpenStackIdentityShell(object):
|
|||||||
cert=args.os_cert,
|
cert=args.os_cert,
|
||||||
insecure=args.insecure,
|
insecure=args.insecure,
|
||||||
debug=args.debug,
|
debug=args.debug,
|
||||||
use_keyring=(not args.no_cache),
|
use_keyring=args.os_cache,
|
||||||
force_new_token=args.force_new_token,
|
force_new_token=args.force_new_token,
|
||||||
stale_duration=args.stale_duration)
|
stale_duration=args.stale_duration)
|
||||||
|
|
||||||
|
@@ -94,14 +94,14 @@ class ShellTest(utils.TestCase):
|
|||||||
'--os-tenant-id 4321 --os-tenant-name wilma '
|
'--os-tenant-id 4321 --os-tenant-name wilma '
|
||||||
'--os-username betty '
|
'--os-username betty '
|
||||||
'--os-identity-api-version 2.0 '
|
'--os-identity-api-version 2.0 '
|
||||||
'--no-cache '
|
'--os-cache '
|
||||||
'--stale-duration 500 '
|
'--stale-duration 500 '
|
||||||
'--force-new-token user-list')
|
'--force-new-token user-list')
|
||||||
assert do_tenant_mock.called
|
assert do_tenant_mock.called
|
||||||
((a, b), c) = do_tenant_mock.call_args
|
((a, b), c) = do_tenant_mock.call_args
|
||||||
actual = (b.os_auth_url, b.os_password, b.os_tenant_id,
|
actual = (b.os_auth_url, b.os_password, b.os_tenant_id,
|
||||||
b.os_tenant_name, b.os_username,
|
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)
|
b.stale_duration, b.force_new_token)
|
||||||
expect = ('http://1.1.1.1:5000/', 'xyzpdq', '4321',
|
expect = ('http://1.1.1.1:5000/', 'xyzpdq', '4321',
|
||||||
'wilma', 'betty', '2.0', True, '500', True)
|
'wilma', 'betty', '2.0', True, '500', True)
|
||||||
|
Reference in New Issue
Block a user