diff options
author | Matt Martz <matt@sivel.net> | 2019-10-14 13:34:07 -0500 |
---|---|---|
committer | Toshio Kuratomi <a.badger@gmail.com> | 2019-10-14 14:33:10 -0700 |
commit | b500ab3232335fbbb38ac205b9c036709ea79202 (patch) | |
tree | 0ca5995c0491cadf037f453bc7a85ad349cbe124 | |
parent | f610ed3a4eb87eb557200606279796921fa9b722 (diff) | |
download | ansible-b500ab3232335fbbb38ac205b9c036709ea79202.tar.gz |
[stable-2.9] Ensure we preserve the /api appended URL (#63472)
(cherry picked from commit d8389d9)
Co-authored-by: Matt Martz <matt@sivel.net>
-rw-r--r-- | changelogs/fragments/ansile-galaxy-preserve-api-append.yml | 3 | ||||
-rw-r--r-- | lib/ansible/galaxy/api.py | 6 |
2 files changed, 6 insertions, 3 deletions
diff --git a/changelogs/fragments/ansile-galaxy-preserve-api-append.yml b/changelogs/fragments/ansile-galaxy-preserve-api-append.yml new file mode 100644 index 0000000000..f9306a9502 --- /dev/null +++ b/changelogs/fragments/ansile-galaxy-preserve-api-append.yml @@ -0,0 +1,3 @@ +bugfixes: +- ansible-galaxy - Ensure we preserve the new URL when appending ``/api`` for the case where + the GET succeeds on galaxy.ansible.com diff --git a/lib/ansible/galaxy/api.py b/lib/ansible/galaxy/api.py index 47caedd1ee..17b1df751d 100644 --- a/lib/ansible/galaxy/api.py +++ b/lib/ansible/galaxy/api.py @@ -57,9 +57,9 @@ def g_connect(versions): raise AnsibleError("Tried to find galaxy API root at %s but no 'available_versions' are available on %s" % (n_url, self.api_server)) - # Update api_server to point to the "real" API root, which in this case - # was the configured url + '/api/' appended. - self.api_server = n_url + # Update api_server to point to the "real" API root, which in this case + # was the configured url + '/api/' appended. + self.api_server = n_url # Default to only supporting v1, if only v1 is returned we also assume that v2 is available even though # it isn't returned in the available_versions dict. |