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

#408 if condition around $pathQualifier #410

Merged
merged 5 commits into from
Nov 1, 2022

Conversation

aaronk1
Copy link
Contributor

@aaronk1 aaronk1 commented Sep 6, 2022

SUMMARY

If statement around $pathQualifier : in case the path parameter is a UNC path

Fixes #408

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

win_acl_inheritance

ADDITIONAL INFORMATION

Before

New-PSDrive : Cannot bind argument to parameter 'Name' because it is null.
At line:12 char:31
+     $null = New-PSDrive -Name $pathQualifier -PSProvider 'Registry' - ...
+                               ~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [New-PSDrive], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.NewPSDriveCommand

After

In testing, this completes successfully and the module runs as expected.

@aaronk1
Copy link
Contributor Author

aaronk1 commented Sep 6, 2022

@briantist please review. Removed the old PR as I messed up a few things accidentally and couldn't squash the ~10 commits. Should all be fixed now. Hoping for successful builds 🤞

Copy link
Contributor

@briantist briantist left a comment

Choose a reason for hiding this comment

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

The change looks good to me, the only thing I'd like to see is an addition for UNC paths. If those were in the tests the issue would have been caught on the original change. Adding them now will prevent regressions.

The tests can be found in tests/integration/targets/win_acl_inheritance and they are written in Ansible.

Would you be up for trying to add a test there?

plugins/modules/win_acl_inheritance.ps1 Show resolved Hide resolved
Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com>
Copy link
Collaborator

@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 as documented under https://docs.ansible.com/ansible/latest/community/development_process.html#creating-a-changelog-fragment to document this bugfix please.

@aaronk1 aaronk1 requested a review from jborean93 September 21, 2022 02:44
@aaronk1
Copy link
Contributor Author

aaronk1 commented Sep 21, 2022

The change looks good to me, the only thing I'd like to see is an addition for UNC paths. If those were in the tests the issue would have been caught on the original change. Adding them now will prevent regressions.

The tests can be found in tests/integration/targets/win_acl_inheritance and they are written in Ansible.

Would you be up for trying to add a test there?

Sure. May be a little until I can get to it though.

@jborean93
Copy link
Collaborator

Just an FYI you can probably just change one of the existing tests so the path is \\localhost\c$\.... The hardest bit will be figuring out how to convert the local path to be \\localhost\c$ but that shouldn't be too hard to achieve.

@github-actions
Copy link

This pull request is stale because it has been open for 4 weeks with no activity. Remove stale label or comment or this will be closed in 2 weeks.

@github-actions github-actions bot added the stale label Oct 20, 2022
@jborean93
Copy link
Collaborator

Will look at adding the tests in the future, for now it will be good to have this change in place.

@jborean93 jborean93 merged commit abb5f23 into ansible-collections:main Nov 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

win_acl_inheritance does not support UNC path with the recent commit
3 participants