Skip to content

Commit f6cdf65

Browse files
[FIX] Fixed ansible issue with max items in request
* Fixed ansible issue with max items in request. 25 is the max value at this moment
1 parent fcf1ba0 commit f6cdf65

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

conf/conf.py

+2
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,5 @@
4848

4949
# Items per page when doing the API call
5050
ITEMS_PER_PAGE = 50
51+
# Ansible has a max limit of 25 Items per page when doing the API call
52+
ANSIBLE_ITEMS_PER_PAGE = 25

execution/execution.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -997,11 +997,11 @@ def get_ansible_unique_hosts():
997997
for page in range(0, num_of_pages):
998998
url = (
999999
"https://console.redhat.com/api/tower-analytics/v1/host_explorer/?sort_by=host_count&limit="
1000-
+ str(conf.ITEMS_PER_PAGE)
1000+
+ str(conf.ANSIBLE_ITEMS_PER_PAGE)
10011001
+ "&offset="
10021002
+ str(count)
10031003
)
1004-
count = count + conf.ITEMS_PER_PAGE
1004+
count = count + conf.ANSIBLE_ITEMS_PER_PAGE
10051005
response = connection_request_post(url, request_data)
10061006

10071007
responseJson = response.json()

0 commit comments

Comments
 (0)