-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Strange behavior between file.comment and file.uncomment #56107
Comments
Related with #24907 ? |
Related with #55085 ? |
@ArthurREGNARD the problem is in your regex: it's too greedy. It matches both commented and not commented lines in your file. So state thinks your line is already uncommented because it matched with your regex. |
Feel free to re-open this if you'll have more questions, though. |
I'm not agree, the documentation say : A regular expression used to find the lines that are to be uncommented.
This regex should not include the comment character. <<<<<<<<<<<<<<<<<< HERE !!
A leading ^ character will be stripped for convenience (for easily switching between comment() and uncomment()). <<<<<<<<<<<<<<<< HERE !!
The regex will be searched for from the beginning of the line, ignoring leading spaces (we prepend '^[ t]*') https://docs.saltstack.com/en/latest/ref/states/all/salt.states.file.html#salt.states.file.uncomment |
@DmitryKuzmenko I can't re-open. |
Possibly same issue as #54260 |
@ArthurREGNARD does this look similar to #54260? |
@ArthurREGNARD sorry for that I didn't know =) I've reopened this |
@OrangeDog @sagetherage it's not. I've just checked the issue #54260 is fixed. |
What about this one now I see this is confusing for users so we should consider possibility of fixing this if it's possible. |
Confirmed it's not fixed. |
@OrangeDog anyway this one is another issue, not the same as #54260. |
Description of Issue
I can't comment and uncomment the same line in a file with the same regex.
Setup
An example.sls:
Steps to Reproduce Issue
Up.
Versions Report
The text was updated successfully, but these errors were encountered: