mirror of
https://github.com/ansible/awx.git
synced 2024-11-01 08:21:15 +03:00
Merge pull request #6985 from chrismeyersfsu/fix-6788
rework hosts without insights creds error message
This commit is contained in:
commit
40aac68402
@ -2119,7 +2119,7 @@ class HostInsights(GenericAPIView):
|
|||||||
if host.inventory and host.inventory.insights_credential:
|
if host.inventory and host.inventory.insights_credential:
|
||||||
cred = host.inventory.insights_credential
|
cred = host.inventory.insights_credential
|
||||||
else:
|
else:
|
||||||
return Response(dict(error=_('No Insights Credential found for the Inventory, "{}", that this host belongs to.').format(host.inventory.name)), status=status.HTTP_404_NOT_FOUND)
|
return Response(dict(error=_('The Insights Credential for "{}" was not found.').format(host.inventory.name)), status=status.HTTP_404_NOT_FOUND)
|
||||||
|
|
||||||
url = settings.INSIGHTS_URL_BASE + '/r/insights/v3/systems/{}/reports/'.format(host.insights_system_id)
|
url = settings.INSIGHTS_URL_BASE + '/r/insights/v3/systems/{}/reports/'.format(host.insights_system_id)
|
||||||
(username, password) = self._extract_insights_creds(cred)
|
(username, password) = self._extract_insights_creds(cred)
|
||||||
|
@ -199,5 +199,5 @@ class TestHostInsights():
|
|||||||
|
|
||||||
resp = view.get(None)
|
resp = view.get(None)
|
||||||
|
|
||||||
assert resp.data['error'] == 'No Insights Credential found for the Inventory, "inventory_name_here", that this host belongs to.'
|
assert resp.data['error'] == 'The Insights Credential for "inventory_name_here" was not found.'
|
||||||
assert resp.status_code == 404
|
assert resp.status_code == 404
|
||||||
|
Loading…
Reference in New Issue
Block a user