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
Move follow_redirects
parameter
#82336
base: devel
Are you sure you want to change the base?
Conversation
You also need to update the docs fragment (and move the documentation there). I'm not sure this is a good solution though, since this is an option that shouldn't be always there for modules using this. It should rather be opt-in, i.e. have another function like (TBH it probably also makes sense to split up the existing |
I made the redirect-spec optional by adding it into its own function. I also created a corresponding doc_fragment and made ansible.builtin.uri use this instead of defining the parameter itself. Offtopic: I'm a bit wondered why the module isn't using the uri-doc_fragment at all. Is this on purpose? Perhaps the docs should be merged into the doc_fragment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You definitely also need a changelog fragment.
Also please note that the url
lookup also has follow_redirects
, although with a different description, a different default, a version_added
, etc. Here you can use the ability to overwrite docs fragments, by including the docs fragment, and specifying
follow_redirects:
description: String of urllib2, all/yes, safe, none to determine how redirects are followed
version_added: "2.10"
default: 'urllib2'
vars:
- name: ansible_lookup_url_follow_redirects
env:
- name: ANSIBLE_LOOKUP_URL_FOLLOW_REDIRECTS
ini:
- section: url_lookup
key: follow_redirects
@@ -0,0 +1,24 @@ | |||
# -*- coding: utf-8 -*- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would personally not add a new docs fragment, but add a sub-docs fragment to the url
docs fragment. Not sure what the Core team prefers though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cannot find any docs on this, but it sounds like the way to go. Could you give me a pointer on how to implement it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the sub-doc fragment. I'm unsure about the uri-lookup docs though. The default there is urllib2
while the uri-module has safe
as default. Would this be overwritten in a wrong manner?
Co-authored-by: Felix Fontein <felix@fontein.de>
…m/monsdar/ansible into issue-82335_Move-follow-redirects
Sorry for the long pause, Christmas got in the way 👀 |
The test
The test
|
SUMMARY
Moves the
follow_redirects
parameter to the url_argument_spec function so external modules like community.general.rundeck_project could use it as well without having to copy it.Fixes #82335
ISSUE TYPE