Skip to content
Open
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
4 changes: 4 additions & 0 deletions changelogs/fragments/fix_pagination.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
bugfixes:
- Strip scheme and hostname from AAP url builder, which previously lead to malformed urls in the ansible.platform.gateway_api lookup plugin
...
3 changes: 3 additions & 0 deletions plugins/module_utils/aap_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,9 @@ def warn(self, warning):
super(AAPModule, self).warn(warning)

def build_url(self, endpoint, query_params=None):
# Remove the host_url part if it is already present
if endpoint.startswith(("https://", "http://")):
endpoint = "/{0}".format('/'.join(endpoint.split('/')[3:]))
# Make sure we start with /api/vX
if not endpoint.startswith("/"):
endpoint = "/{0}".format(endpoint)
Expand Down
Loading