powershell: do not quote join_path result to reflect ShellBase join_path (#45944)
This commit is contained in:
parent
ce515a626c
commit
198423d6fb
3 changed files with 7 additions and 1 deletions
2
changelogs/fragments/win_copy-dest-quote.yaml
Normal file
2
changelogs/fragments/win_copy-dest-quote.yaml
Normal file
|
@ -0,0 +1,2 @@
|
|||
bugfixes:
|
||||
- win_copy - Fix issue where the dest return value would be enclosed in single quote when dest is a folder - https://github.com/ansible/ansible/issues/45281
|
|
@ -1503,7 +1503,7 @@ class ShellModule(ShellBase):
|
|||
path = '\\'.join(parts)
|
||||
if path.startswith('~'):
|
||||
return path
|
||||
return '\'%s\'' % path
|
||||
return path
|
||||
|
||||
def get_remote_filename(self, pathname):
|
||||
# powershell requires that script files end with .ps1
|
||||
|
|
|
@ -134,6 +134,7 @@
|
|||
that:
|
||||
- copy_file_check is changed
|
||||
- copy_file_check.checksum == 'c79a6506c1c948be0d456ab5104d5e753ab2f3e6'
|
||||
- copy_file_check.dest == test_win_copy_path + '\\foo-target.txt'
|
||||
- copy_file_check.operation == 'file_copy'
|
||||
- copy_file_check.size == 8
|
||||
- copy_file_actual_check.stat.exists == False
|
||||
|
@ -154,6 +155,7 @@
|
|||
that:
|
||||
- copy_file is changed
|
||||
- copy_file.checksum == 'c79a6506c1c948be0d456ab5104d5e753ab2f3e6'
|
||||
- copy_file.dest == test_win_copy_path + '\\foo-target.txt'
|
||||
- copy_file.operation == 'file_copy'
|
||||
- copy_file.size == 8
|
||||
- copy_file_actual.stat.exists == True
|
||||
|
@ -187,6 +189,7 @@
|
|||
that:
|
||||
- copy_file_to_folder_check is changed
|
||||
- copy_file_to_folder_check.checksum == 'c79a6506c1c948be0d456ab5104d5e753ab2f3e6'
|
||||
- copy_file_to_folder_check.dest == test_win_copy_path + '\\foo.txt'
|
||||
- copy_file_to_folder_check.operation == 'file_copy'
|
||||
- copy_file_to_folder_check.size == 8
|
||||
- copy_file_to_folder_actual_check.stat.exists == False
|
||||
|
@ -207,6 +210,7 @@
|
|||
that:
|
||||
- copy_file_to_folder is changed
|
||||
- copy_file_to_folder.checksum == 'c79a6506c1c948be0d456ab5104d5e753ab2f3e6'
|
||||
- copy_file_to_folder.dest == test_win_copy_path + '\\foo.txt'
|
||||
- copy_file_to_folder.operation == 'file_copy'
|
||||
- copy_file_to_folder.size == 8
|
||||
- copy_file_to_folder_actual.stat.exists == True
|
||||
|
|
Loading…
Reference in a new issue