Commit c7aede9
committed
Fix file.managed error prefix and redact basic-auth in source_hash errors
Forward-port from 3008.x commit 3fafbbe to master:
- salt/states/file.py: prefix the early `_error()` return in
`file.managed` with "Unable to manage file:" so callers and tests can
reliably distinguish the manage-file failure path from other state
errors. Restores the assertion checked by
tests/pytests/functional/states/file/test_managed.py::test_issue_60203,
which is failing across every functional-zeromq-3 chunk on master.
- salt/modules/file.py: route the `source_hash` value through
`salt.utils.url.redact_http_basic_auth()` in both the "format is
invalid" and "Source hash file not found" error paths of
`get_source_sum()` so HTTP basic-auth credentials are not leaked into
state comments or logs when the source hash URI is malformed or
unreachable.1 parent 1f718c4 commit c7aede9
1 file changed
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
0 commit comments