Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed ansible issue with max items in request #227

Merged
merged 2 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions conf/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,5 @@

# Items per page when doing the API call
ITEMS_PER_PAGE = 50
waldirio marked this conversation as resolved.
Show resolved Hide resolved
# Ansible has a max limit of 25 Items per page when doing the API call
ANSIBLE_ITEMS_PER_PAGE = 25
4 changes: 2 additions & 2 deletions execution/execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
waldirio marked this conversation as resolved.
Show resolved Hide resolved
+ "&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()
Expand Down
Loading