diff --git a/conf/conf.py b/conf/conf.py index a1b4ed9..43d5510 100644 --- a/conf/conf.py +++ b/conf/conf.py @@ -48,3 +48,5 @@ # Items per page when doing the API call ITEMS_PER_PAGE = 50 +# Ansible has a max limit of 25 Items per page when doing the API call +ANSIBLE_ITEMS_PER_PAGE = 25 diff --git a/execution/execution.py b/execution/execution.py index 721ba36..93223f0 100644 --- a/execution/execution.py +++ b/execution/execution.py @@ -997,11 +997,11 @@ def get_ansible_unique_hosts(): for page in range(0, num_of_pages): url = ( "https://console.redhat.com/api/tower-analytics/v1/host_explorer/?sort_by=host_count&limit=" - + str(conf.ITEMS_PER_PAGE) + + str(conf.ANSIBLE_ITEMS_PER_PAGE) + "&offset=" + str(count) ) - count = count + conf.ITEMS_PER_PAGE + count = count + conf.ANSIBLE_ITEMS_PER_PAGE response = connection_request_post(url, request_data) responseJson = response.json()