mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 18:09:57 -03:30
consolidate a few license code function calls
This commit is contained in:
parent
be4e4ff47c
commit
1294efdeb9
@ -187,7 +187,7 @@ class APIView(views.APIView):
|
||||
'''
|
||||
Log warning for 400 requests. Add header with elapsed time.
|
||||
'''
|
||||
from awx.main.utils.common import get_licenser
|
||||
from awx.conf.license import get_license
|
||||
|
||||
#
|
||||
# If the URL was rewritten, and we get a 404, we should entirely
|
||||
@ -224,7 +224,7 @@ class APIView(views.APIView):
|
||||
response = super(APIView, self).finalize_response(request, response, *args, **kwargs)
|
||||
time_started = getattr(self, 'time_started', None)
|
||||
response['X-API-Product-Version'] = get_awx_version()
|
||||
response['X-API-Product-Name'] = 'AWX' if get_licenser().validate().get('license_type') == 'open' else 'Red Hat Ansible Tower'
|
||||
response['X-API-Product-Name'] = 'AWX' if get_license().get('license_type') == 'open' else 'Red Hat Ansible Tower'
|
||||
|
||||
response['X-API-Node'] = settings.CLUSTER_HOST_ID
|
||||
if time_started:
|
||||
|
||||
@ -5,8 +5,8 @@ __all__ = ['get_license']
|
||||
|
||||
|
||||
def _get_validated_license_data():
|
||||
from awx.main.utils.licensing import Licenser
|
||||
return Licenser().validate()
|
||||
from awx.main.utils import get_licenser
|
||||
return get_licenser().validate()
|
||||
|
||||
|
||||
def get_license():
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user