-
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
[BUG] unused assignment in file.patch #57204
Comments
@OrangeDog I see after the line the |
@DmitryKuzmenko read more carefully. That's not the same You can trivially construct any example: patch example:
- file.patch:
- name: /path
- source: salt://foo.patch
- options: [--backup] The option won't be used, and no backups will be made. |
@OrangeDog good catch. You're right, thank you. |
I made this state to test this issue:
Then I executed the state.apply:
During execution, I could see the '--backup' option passed to 'patch' command:
And the backup file was created as expected:
The code, indeed, doesn't use the "options" variable after setting "options = sanitized_options", but uses the original "sanitized_options":
Am I missing something? |
@piterpunk hmm, you are correct. Not sure how Dmitry and I convinced ourselves otherwise. I think all that needs doing is remove the |
Description
The state
file.patch
documents anoptions
argument.However, the code never uses them. It sanitises them and reports errors, but the variable is unused after this line: https://github.com/saltstack/salt/blob/v3000.2/salt/states/file.py#L6192
The text was updated successfully, but these errors were encountered: