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

fix win_unzip and win_share Powershell cmdlets output invalid JSONs #42713

Merged
merged 1 commit into from Jul 13, 2018
Merged

fix win_unzip and win_share Powershell cmdlets output invalid JSONs #42713

merged 1 commit into from Jul 13, 2018

Conversation

avishefi
Copy link
Contributor

SUMMARY

Fixes #42554 - Powershell cmdlets for win_unzip and win_share make modules return STDOUT invalid JSON strings.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

win_unzip
win_share

ANSIBLE VERSION

Affects 2.5 and 2.6

ansible 2.5.2
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/root/.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, Feb 20 2018, 09:19:12) [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)]

@ansibot
Copy link
Contributor

ansibot commented Jul 12, 2018

@ansibot ansibot added 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. needs_triage Needs a first human triage before being processed. new_contributor This PR is the first contribution by a new community member. 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 labels Jul 12, 2018
@schwartzmx
Copy link
Contributor

lgtm shipit

@ansibot ansibot removed the needs_triage Needs a first human triage before being processed. label Jul 13, 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.

Looks good to me, while you don't have to change it, for future references using | Out-Null is a more expensive operation than doing either

[void]Some-Cmdlet
Some-Cmdlet > $null

They achieve the same thing as Some-Cmdlet | Out-Null but don't take as long.

https://stackoverflow.com/questions/5260125/whats-the-better-cleaner-way-to-ignore-output-in-powershell

@jborean93 jborean93 merged commit b2527c5 into ansible:devel Jul 13, 2018
jborean93 pushed a commit to jborean93/ansible that referenced this pull request Jul 13, 2018
@jborean93
Copy link
Contributor

Backport PR to stable-2.6 #42721

@avishefi
Copy link
Contributor Author

@jborean93 thanks for the feedback and backporting it to 2.6

@avishefi avishefi deleted the cmdlets_output_handling branch July 13, 2018 12:08
mattclay pushed a commit that referenced this pull request Jul 17, 2018
* fix win_unzip and win_share Powershell cmdlets output invalid JSONs (#42713)


(cherry picked from commit b2527c5)

* Added changelog fragment
@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. new_contributor This PR is the first contribution by a new community member. 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.

Improper Windows modules cmdlets output handling
5 participants