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

files: fix docs about type of the mode parameter #61232

Open
wants to merge 2 commits into
base: devel
from

Conversation

@sourcejedi
Copy link

commented Aug 23, 2019

SUMMARY

mode is an octal or symbolic mode, for the unix file permission. It is
not a path, as the docs for the copy module suggest.

Document the various mode parameters as being of type as "raw".

The directory_mode parameter of the copy module was already of type
"raw". Perhaps this looks a bit weird, but the documentation text for
mode is very explicit about how it allows both integer and string values.

ansible-test sanity --test validate-modules missed some inconcistencies
between the docs and the code due to how the common file arguments work.
(I noticed it yelled at me if I introduce a discrepancy elsewhere).
I think this change removes inconsistencies.

ISSUE TYPE
  • Docs Pull Request
COMPONENT NAME

copy

ADDITIONAL INFORMATION

n/a

@ansibot

This comment has been minimized.

Copy link
Contributor

commented Aug 23, 2019

@ansibot

This comment has been minimized.

Copy link
Contributor

commented Aug 23, 2019

The test ansible-test sanity --test validate-modules [explain] failed with 3 errors:

lib/ansible/modules/files/copy.py:0:0: E305 DOCUMENTATION.options.directory_mode.type: not a valid value for dictionary value @ data['options']['directory_mode']['type']. Got 'string'
lib/ansible/modules/files/copy.py:0:0: E305 DOCUMENTATION.options.mode.type: not a valid value for dictionary value @ data['options']['mode']['type']. Got 'string'
lib/ansible/modules/files/copy.py:0:0: E325 Argument 'directory_mode' in argument_spec defines type as 'raw' but documentation defines type as 'string'

click here for bot help

@sourcejedi sourcejedi force-pushed the sourcejedi:patch-5 branch from 87a2e01 to 2699a69 Aug 23, 2019

@sourcejedi sourcejedi changed the title copy: fix docs about type of the mode parameter files: fix docs about type of the mode parameter Aug 23, 2019

@sourcejedi

This comment has been minimized.

Copy link
Author

commented Aug 23, 2019

Thanks @ansibot! I've re-written it, including the PR description.

sourcejedi added 2 commits Aug 23, 2019
files: fix docs about type of the mode parameter
`mode` is an octal or symbolic mode, for the unix file permission.  It is
not a path, as the docs for the copy module suggest.

Document the various mode parameters as being of type as "raw".

The `directory_mode` parameter of the copy module was already of type
"raw".  Perhaps this looks a bit weird, but the documentation text for
`mode` is very explicit about how it allows both integer and string values.

`ansible-test sanity --test validate-modules` missed some inconcistencies
between the docs and the code due to how the common file arguments work.
(I noticed it yelled at me if I introduce a discrepancy elsewhere).
I think this change removes inconsistencies.
module_utils: remove unused function get_file_args_spec()
GitHub code search suggests no-one refers to this.  Including us
(or our docs).

We know what happens to dead code.  Let's send it to the bitbucket in the
sky.

@sourcejedi sourcejedi force-pushed the sourcejedi:patch-5 branch from 2699a69 to 56f32fa Aug 24, 2019

@sourcejedi

This comment has been minimized.

Copy link
Author

commented Aug 24, 2019

I pushed the wrong version :-(. Third time lucky?

@sourcejedi

This comment has been minimized.

Copy link
Author

commented Aug 24, 2019

Ok, maybe the remaining test failures are not my fault? I couldn't find any relevant errors. Test 75 looks like a failure to contact the repo, and 111 just took a little too long. I don't understand where the error is in 85.

@acozine

This comment has been minimized.

Copy link
Contributor

commented Aug 28, 2019

@sourcejedi thank you for your interest in making the Ansible documentation the best it can be!

I'm not sure this is the right fix, though - why did you remove the shared argspec?

@acozine acozine removed the needs_triage label Aug 28, 2019

@sourcejedi

This comment has been minimized.

Copy link
Author

commented Aug 28, 2019

Hi again @acozine. It's because I don't think the argspec is shared by anything :-).

If you're worried about the few test failures, I can split it into a separate PR so we can confirm that's not the problem. Or you can tell me this opportunistic refactoring needs to be considered as a separate PR :-). The other commit does not depend on it.

module_utils: remove unused function get_file_args_spec()

GitHub code search suggests no-one refers to this. Including us
(or our docs).

We know what happens to dead code. Let's send it to the bitbucket in the
sky.

@ansibot ansibot added the stale_ci label Sep 13, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.