diff --git a/awx/api/generics.py b/awx/api/generics.py index e0b06f6299..83780ad03c 100644 --- a/awx/api/generics.py +++ b/awx/api/generics.py @@ -45,7 +45,10 @@ from awx.main.utils import ( get_search_fields, getattrd, get_object_or_400, - decrypt_field + decrypt_field, + get_awx_version, + get_licenser, + StubLicense ) from awx.main.utils.db import get_all_field_names from awx.api.serializers import ResourceAccessListElementSerializer, CopySerializer, UserSerializer @@ -197,6 +200,8 @@ class APIView(views.APIView): logger.warning(status_msg) 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 isinstance(get_licenser(), StubLicense) else 'Red Hat Ansible Tower' response['X-API-Node'] = settings.CLUSTER_HOST_ID if time_started: time_elapsed = time.time() - self.time_started diff --git a/awx/main/utils/common.py b/awx/main/utils/common.py index cc3272794f..a5e8bccff2 100644 --- a/awx/main/utils/common.py +++ b/awx/main/utils/common.py @@ -56,6 +56,7 @@ __all__ = [ 'has_model_field_prefetched', 'set_environ', 'IllegalArgumentError', 'get_custom_venv_choices', 'get_external_account', 'task_manager_bulk_reschedule', 'schedule_task_manager', 'classproperty', 'create_temporary_fifo', 'truncate_stdout', + 'StubLicense' ]