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

[stable-2.16] Enable directly using AnsibleUnsafeText with Python pathlib #82510

Merged
merged 5 commits into from
Jan 18, 2024

Conversation

sivel
Copy link
Member

@sivel sivel commented Jan 9, 2024

SUMMARY

Enable directly using AnsibleUnsafeText with Python pathlib. Fixes #82414

ISSUE TYPE
  • Bugfix Pull Request
ADDITIONAL INFORMATION
>>> from ansible.utils.unsafe_proxy import AnsibleUnsafeText
>>> import pathlib
>>> pathlib.Path(AnsibleUnsafeText('/tmp'))
PosixPath('/tmp')

@sivel sivel requested a review from nitzmahone January 9, 2024 23:32
@ansibot ansibot added bug This issue/PR relates to a bug. needs_triage Needs a first human triage before being processed. backport This PR does not target the devel branch. labels Jan 9, 2024
Copy link
Member

@webknjaz webknjaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about some tests?

@sivel sivel changed the title Enable directly using AnsibleUnsafeText with Python pathlib [stable-2.16] Enable directly using AnsibleUnsafeText with Python pathlib Jan 10, 2024
Copy link
Member

@nitzmahone nitzmahone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one suggestion for defensive patching

lib/ansible/utils/unsafe_proxy.py Outdated Show resolved Hide resolved
@ansibot ansibot added the needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. label Jan 10, 2024
@ansibot ansibot added stale_review Updates were made after the last review and the last review is more than 7 days old. and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Jan 10, 2024
@ansibot ansibot removed the stale_review Updates were made after the last review and the last review is more than 7 days old. label Jan 18, 2024
@sivel sivel requested a review from mattclay January 18, 2024 18:02
@ansibot ansibot added the stale_review Updates were made after the last review and the last review is more than 7 days old. label Jan 18, 2024
@ansibot ansibot removed the stale_review Updates were made after the last review and the last review is more than 7 days old. label Jan 18, 2024
@sivel sivel merged commit c6a652c into ansible:stable-2.16 Jan 18, 2024
78 checks passed
sivel added a commit to sivel/ansible that referenced this pull request Jan 18, 2024
… with Python `pathlib` (ansible#82510)

* Enable directly using `AnsibleUnsafeText` with Python `pathlib`. Fixes ansible#82414.
(cherry picked from commit c6a652c)

Co-authored-by: Matt Martz <matt@sivel.net>
sivel added a commit to sivel/ansible that referenced this pull request Jan 18, 2024
… with Python `pathlib` (ansible#82510)

* Enable directly using `AnsibleUnsafeText` with Python `pathlib`. Fixes ansible#82414.
(cherry picked from commit c6a652c)

Co-authored-by: Matt Martz <matt@sivel.net>
sivel added a commit to sivel/ansible that referenced this pull request Jan 18, 2024
…ble#82510)

* Enable directly using `AnsibleUnsafeText` with Python `pathlib`. Fixes ansible#82414.
(cherry picked from commit c6a652c)

Co-authored-by: Matt Martz <matt@sivel.net>
sivel added a commit to sivel/ansible that referenced this pull request Jan 18, 2024
…ble#82510)

* Enable directly using `AnsibleUnsafeText` with Python `pathlib`. Fixes ansible#82414.
(cherry picked from commit c6a652c)

Co-authored-by: Matt Martz <matt@sivel.net>
@sivel sivel removed the needs_triage Needs a first human triage before being processed. label Jan 18, 2024
sivel added a commit that referenced this pull request Jan 18, 2024
…) (#82564)

* Enable directly using `AnsibleUnsafeText` with Python `pathlib`. Fixes #82414.
(cherry picked from commit c6a652c)
sivel added a commit that referenced this pull request Jan 18, 2024
…) (#82563)

* Enable directly using `AnsibleUnsafeText` with Python `pathlib`. Fixes #82414.
(cherry picked from commit c6a652c)
@ansible ansible locked and limited conversation to collaborators Feb 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport This PR does not target the devel branch. bug This issue/PR relates to a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants