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

win_stat: Rewrite using AnsibleModule #49653

Open
wants to merge 4 commits into
base: devel
from

Conversation

Projects
None yet
5 participants
@dagwieers
Copy link
Member

dagwieers commented Dec 7, 2018

SUMMARY

Simple rewrite using AnsibleModule.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

win_stat

win_stat: Rewrite using AnsibleModule
Simple rewrite using AnsibleModule.

@dagwieers dagwieers force-pushed the dagwieers:win_stat-rewrite branch from b3415ff to e977dfe Dec 7, 2018

Remove custom deprecate block
Since we already have the `removed_in_version` option set, this is not
really needed. However the error message was a bit more specific.
@ansibot

This comment has been minimized.

Copy link
Contributor

ansibot commented Dec 7, 2018

@ansibot

This comment was marked as resolved.

Copy link
Contributor

ansibot commented Dec 7, 2018

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

lib/ansible/modules/windows/win_stat.ps1:31:1: PSUseDeclaredVarsMoreThanAssignments The variable 'checksum_algortihm' is assigned but never used.

click here for bot help

@ansibot ansibot added needs_revision and removed core_review labels Dec 7, 2018

Show resolved Hide resolved lib/ansible/modules/windows/win_stat.ps1 Outdated
path = @{ type='path'; required=$true; aliases=@( 'dest', 'name' ) }
get_checksum = @{ type='bool'; default=$true }
checksum_algorithm = @{ type='str'; default='sha1'; choices=@( 'md5', 'sha1', 'sha256', 'sha384', 'sha512' ) }
get_md5 = @{ type='bool'; default=$false; removed_in_version='2.9' }

This comment has been minimized.

@jborean93

jborean93 Dec 12, 2018

Contributor

I don't think we can use removed_in_version for get_md5. The actual option is set to become "undocumented" in 2.9 but still available due to win_stat and stat being a stableinterface and people wanting a very slow removal.

This comment has been minimized.

@dagwieers

dagwieers Dec 15, 2018

Member

Ok, makes sense.

This comment has been minimized.

@dagwieers

dagwieers Dec 15, 2018

Member

The actual problem here is that we can no longer check if get_md5 was being set. So if we want to do this in the new world order, we need a way to check if parameters were set by the user.

This comment has been minimized.

@jborean93

jborean93 Dec 18, 2018

Contributor

You can still check it by not setting a default for get_md5 and seeing if it is $null. If it is null we would just need to manually set to $false until we eventually remove it.

Show resolved Hide resolved lib/ansible/modules/windows/win_stat.ps1 Outdated
Show resolved Hide resolved lib/ansible/modules/windows/win_stat.ps1 Outdated
@mattclay

This comment has been minimized.

Copy link
Member

mattclay commented Dec 19, 2018

@ansibot ansibot added the stale_ci label Dec 27, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment