Refactor HostInsights

for better reuse of the error handling of the Insights API calls.
This commit is contained in:
Jeff Bradberry
2019-04-08 16:44:21 -04:00
parent 596a5173ce
commit a97865de0c
3 changed files with 83 additions and 148 deletions

View File

@@ -81,7 +81,7 @@ class ActionModule(ActionBase):
url = res.json()['links']['next'] # will be None if we're on the last page
for item in res.json()['remediations']:
for item in res.json()['data']:
playbook_url = '{}/api/remediations/v1/remediations/{}/playbook'.format(
insights_url, item['id'])
res = session.get(playbook_url, timeout=120)