mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Force file removal on Windows. Fixes #42295
This commit is contained in:
parent
a91a3f81b1
commit
026ccf401a
1 changed files with 4 additions and 1 deletions
|
@ -1040,7 +1040,10 @@ def absent(name):
|
|||
ret['comment'] = 'File {0} is set for removal'.format(name)
|
||||
return ret
|
||||
try:
|
||||
__salt__['file.remove'](name)
|
||||
if salt.utils.is_windows():
|
||||
__salt__['file.remove'](name, force=True)
|
||||
else:
|
||||
__salt__['file.remove'](name)
|
||||
ret['comment'] = 'Removed file {0}'.format(name)
|
||||
ret['changes']['removed'] = name
|
||||
return ret
|
||||
|
|
Loading…
Add table
Reference in a new issue