Merge "Remove unused skip_authentication decorator"

This commit is contained in:
Jenkins 2016-06-21 16:13:59 +00:00 committed by Gerrit Code Review
commit 985df912e1
2 changed files with 1 additions and 18 deletions
glanceclient

@ -246,21 +246,6 @@ def find_resource(manager, name_or_id):
return matches[0]
def skip_authentication(f):
"""Function decorator used to indicate a caller may be unauthenticated."""
f.require_authentication = False
return f
def is_authentication_required(f):
"""Checks to see if the function requires authentication.
Use the skip_authentication decorator to indicate a caller may
skip the authentication step.
"""
return getattr(f, 'require_authentication', True)
def env(*vars, **kwargs):
"""Search for the first defined of possibly many env vars.

@ -421,9 +421,7 @@ class OpenStackImagesShell(object):
endpoint = self._get_image_url(args)
auth_token = args.os_auth_token
auth_req = (hasattr(args, 'func') and
utils.is_authentication_required(args.func))
if not auth_req or (endpoint and auth_token):
if endpoint and auth_token:
kwargs = {
'token': auth_token,
'insecure': args.insecure,