atomic_move document and warn required abspath, also update callers#83951
atomic_move document and warn required abspath, also update callers#83951bcoca wants to merge 9 commits into
Conversation
This comment was marked as off-topic.
This comment was marked as off-topic.
| dest_hash = None | ||
| src = module.params['src'] | ||
| dest = module.params['dest'] | ||
| dest = os.path.abspath(module.params['dest']) |
There was a problem hiding this comment.
Instead of expecting individual modules to convert paths to absolute, we should incorporate the check into the validation for path type module parameters. A deprecation warning can be issued there, and later converted to an error. Once we have controller-side argument processing, it will be able to perform the relative path check.
Having a deprecation warning on atomic_move may still be a good idea, in case there are other direct callers.
There was a problem hiding this comment.
agreed the conversion belongs in validation, but I did not want to change it for many other modules that use that as a type but do not require abspath. Also not something I would resolve on controller since paths can differ.
There was a problem hiding this comment.
I wasn't suggesting the controller would be able to resolve the path, just to error out if it's not absolute.
There was a problem hiding this comment.
We should avoid calling abspath on these paths, since that will prevent the warning from being shown. Users need to know that the path(s) they have provided may not work as intended. The current working directly isn't always predictable, such as when dropping privileges on macOS, so converting to absolute here just hides the issue.
Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
related #83950
ISSUE TYPE