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

Switch to LiteralPath instead of Path. Closes #44508 #44509

Merged
merged 4 commits into from Aug 27, 2018

Conversation

crossan007
Copy link
Contributor

@crossan007 crossan007 commented Aug 22, 2018

SUMMARY

Change all instances of -Path to -LiteralPath

Closes #44508

Similar to https://github.com/ansible/ansible/pull/37901/files#diff-62fd6612943ccdb6cd026094c9d4763bR90

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

win_lineinfile

ANSIBLE VERSION
ansible 2.6.2
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/home/vagrant/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.5 (default, Jul 13 2018, 13:06:57) [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)]

ADDITIONAL INFORMATION

https://www.reddit.com/r/PowerShell/comments/2wmzv8/why_you_should_consider_always_using_literalpath/

It's worth noting that the bracket usage within PowerShell paths does provide some functionality; however, I believe that the majority of Ansible playbook authors are not expecting PowerShell variable expansion / interpretation to occur on the paths passed to win_lineinfile.

@ansibot
Copy link
Contributor

ansibot commented Aug 22, 2018

@ansibot ansibot added affects_2.7 This issue/PR affects Ansible v2.7 bug This issue/PR relates to a bug. community_review In order to be merged, this PR must follow the community review workflow. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. support:community This issue/PR relates to code supported by the Ansible community. windows Windows community labels Aug 22, 2018
@jborean93 jborean93 removed the needs_triage Needs a first human triage before being processed. label Aug 23, 2018
Copy link
Contributor

@jborean93 jborean93 left a comment

Choose a reason for hiding this comment

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

Are you able to add a changelog fragment for this fix?

@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed community_review In order to be merged, this PR must follow the community review workflow. labels Aug 23, 2018
@crossan007
Copy link
Contributor Author

@jborean93 like so?

@ansibot
Copy link
Contributor

ansibot commented Aug 23, 2018

The test ansible-test sanity --test line-endings [explain] failed with 1 error:

changelogs/fragments/44508-win_lineinfile.yaml:0:0: use "\n" for line endings instead of "\r\n"

click here for bot help

@ansibot ansibot added ci_verified Changes made in this PR are causing tests to fail. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Aug 23, 2018
@ansibot ansibot added support:community This issue/PR relates to code supported by the Ansible community. and removed ci_verified Changes made in this PR are causing tests to fail. support:community This issue/PR relates to code supported by the Ansible community. labels Aug 23, 2018
@ansibot ansibot added core_review In order to be merged, this PR must follow the core review workflow. and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Aug 27, 2018
@jborean93 jborean93 merged commit a7f35e2 into ansible:devel Aug 27, 2018
@jborean93
Copy link
Contributor

@crossan007 are you able to create a backport PR to bring the fix to the stable-2.6 branch. Details on how to do this can be found here https://docs.ansible.com/ansible/latest/community/development_process.html#pull-requests.

alikins added a commit that referenced this pull request Aug 27, 2018
* devel: (513 commits)
  Fix systemd service is already masked issue (#44730)
  fix issue with no_log in py3
  modules/terraform: Quote the variable values in the command line (#43493)
  YUM4/DNF compatibility via yum action plugin (#44322)
  BOTMETA.yml: remove superfluous labels (#44628)
  Share the implementation of hashing for both vars_prompt and password_hash (#21215)
  one_host environment variables, Fixes #44163 (#44568)
  ec2: add "IAM Role" to instance_profile_name
  ios_vrf speed fix (#43765)
  fix typo (#44712)
  junos cli_config idempotence fix (#44706)
  Switch to LiteralPath instead of Path. Closes #44508 (#44509)
  Module win_domain_computer fix delete computer with child (#44500)
  ACME: improve documentation (#44691)
  doc: fixed typo (#44685)
  IPA: Add option to specify timeout (#44572)
  Added nios_txt_record module (#39264)
  adds the bigip_cli_script module (#44674)
  Clean up BOTMETA.yml (#44574)
  Change validate-modules for removed modules
  ...
@ansible ansible locked and limited conversation to collaborators Jul 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.7 This issue/PR affects Ansible v2.7 bug This issue/PR relates to a bug. core_review In order to be merged, this PR must follow the core review workflow. module This issue/PR relates to a module. support:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team. windows Windows community
Projects
None yet
Development

Successfully merging this pull request may close these issues.

win_lineinfile fails when path contains bracket
3 participants