salt.states.file.copy force=true on Windows does not clear the Read-Only attribute during removal #51739
Labels
Bug
broken, incorrect, or confusing behavior
P4
Priority 4
severity-medium
3rd level, incorrect or bad functionality, confusing and lacks a work around
Milestone
Description of Issue/Question
On the windows platform, when using file.copy where the source has a file with a read-only attribute (
attrib +r
), the call tofile.remove
fails with an exception and so the whole state fails.Setup
Setup a Windows box, drop a directory with some files that have the readonly attribute set. You can enable the +r attribute via
attrib +r $filename
at the command prompt.Steps to Reproduce Issue
Once you have a source directory with the prior mentioned constraints, just use a state with
file.copy
and theforce
parameter set totrue
. After the copy happens, the second time you apply the state you'll get the following exception:Versions Report
The text was updated successfully, but these errors were encountered: