1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

aci_rest: Fix ignoring custom port (#49715)

This commit is contained in:
Dag Wieers 2018-12-10 15:08:06 +01:00 committed by GitHub
parent 270b6a2ee2
commit 37820be05b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View file

@ -0,0 +1,3 @@
---
bugfixes:
- aci_rest - Fix issue ignoring custom port

View file

@ -387,8 +387,11 @@ def main():
except Exception as e: except Exception as e:
module.fail_json(msg='Failed to parse provided XML payload: %s' % to_text(e), payload=payload) module.fail_json(msg='Failed to parse provided XML payload: %s' % to_text(e), payload=payload)
# Perform actual request using auth cookie (Same as aci_request, but also supports XML) # Perform actual request using auth cookie (Same as aci.request(), but also supports XML)
aci.url = '%(protocol)s://%(host)s/' % aci.params + path.lstrip('/') if 'port' in aci.params and aci.params['port'] is not None:
aci.url = '%(protocol)s://%(host)s:%(port)s/' % aci.params + path.lstrip('/')
else:
aci.url = '%(protocol)s://%(host)s/' % aci.params + path.lstrip('/')
if aci.params['method'] != 'get': if aci.params['method'] != 'get':
path += '?rsp-subtree=modified' path += '?rsp-subtree=modified'
aci.url = update_qsl(aci.url, {'rsp-subtree': 'modified'}) aci.url = update_qsl(aci.url, {'rsp-subtree': 'modified'})