diff --git a/awx/api/views/__init__.py b/awx/api/views/__init__.py index 5b2114153f..96362d7591 100644 --- a/awx/api/views/__init__.py +++ b/awx/api/views/__init__.py @@ -1655,7 +1655,8 @@ class HostInsights(GenericAPIView): return res.json() except ValueError: raise BadGateway( - _('Expected JSON response from Insights but instead got {}').format(res.content)) + _('Expected JSON response from Insights at URL {}' + ' but instead got {}').format(url, res.content)) def _get_session(self, username, password): session = requests.Session() diff --git a/awx/main/tests/functional/api/test_host_insights.py b/awx/main/tests/functional/api/test_host_insights.py index d22471406f..348ca02952 100644 --- a/awx/main/tests/functional/api/test_host_insights.py +++ b/awx/main/tests/functional/api/test_host_insights.py @@ -129,5 +129,7 @@ class TestHostInsights: url = reverse('api:host_insights', kwargs={'pk': host.pk}) response = get(url, user('admin', True)) - assert response.data['error'] == "Expected JSON response from Insights but instead got booo!" + assert response.data['error'].startswith("Expected JSON response from Insights at URL") + assert 'insights_id=123e4567-e89b-12d3-a456-426655440000' in response.data['error'] + assert response.data['error'].endswith("but instead got booo!") assert response.status_code == 502 diff --git a/awx/ui/client/src/inventories-hosts/inventories/insights/plan-filter.js b/awx/ui/client/src/inventories-hosts/inventories/insights/plan-filter.js index 5c404acaaf..27259feac0 100644 --- a/awx/ui/client/src/inventories-hosts/inventories/insights/plan-filter.js +++ b/awx/ui/client/src/inventories-hosts/inventories/insights/plan-filter.js @@ -7,7 +7,7 @@ export default function(){ return function(plan) { if(plan === null || plan === undefined){ - return "PLAN: Not Available CREATE A NEW PLAN IN INSIGHTS"; + return "PLAN: Not Available CREATE A NEW PLAN IN INSIGHTS"; } else { let name = (plan.name === null) ? "Unnamed Plan" : plan.name; return `${name} (${plan.id})`;