windows - Fix module utils with glob paths (#53835)

* windows - Fix module utils with glob paths

* fix link util tests when using DOS 8.3 paths
This commit is contained in:
Jordan Borean 2019-03-15 19:44:53 +10:00 committed by GitHub
parent a6a4e82984
commit 980ca564ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 45 additions and 26 deletions

View file

@ -425,7 +425,7 @@ Function Remove-Link($link_path) {
}
Function New-Link($link_path, $link_target, $link_type) {
if (-not (Test-Path -Path $link_target)) {
if (-not (Test-Path -LiteralPath $link_target)) {
throw "link_target '$link_target' does not exist, cannot create link"
}
@ -434,13 +434,13 @@ Function New-Link($link_path, $link_target, $link_type) {
$type = [Ansible.LinkType]::SymbolicLink
}
"junction" {
if (Test-Path -Path $link_target -PathType Leaf) {
if (Test-Path -LiteralPath $link_target -PathType Leaf) {
throw "cannot set the target for a junction point to a file"
}
$type = [Ansible.LinkType]::JunctionPoint
}
"hard" {
if (Test-Path -Path $link_target -PathType Container) {
if (Test-Path -LiteralPath $link_target -PathType Container) {
throw "cannot set the target for a hard link to a directory"
}
$type = [Ansible.LinkType]::HardLink