Commit c4aae18
authored
fix: detect rfc5424 changes on existing syslog destinations (#436)
rfc5424 was in FIELDS_ALL but not FIELDS_CHANGE. update() (base module)
only compares FIELDS_CHANGE to detect drift, so flipping rfc5424 on an
existing destination yielded changed=False and no API POST — the setting
silently no-oped and had to be applied by hand in the GUI. The POST
payload builder iterates FIELDS_ALL and already included rfc5424, so the
value applied once some other change triggered an update; the gap was
purely change detection.
Add rfc5424 to FIELDS_CHANGE (and drop it from the FIELDS_ALL literal,
since FIELDS_ALL extends FIELDS_CHANGE) so a standalone rfc5424 change is
detected. The OPNsense Syslog model stores rfc5424 as a BooleanField
returned by the API, so detection reads the real current value and stays
idempotent; drop the stale "not getting current value from response"
comment that claimed otherwise. Add a change-detection/idempotency
regression to tests/syslog.yml.
Assisted-By: Claude <noreply@anthropic.com>1 parent 8b8da47 commit c4aae18
3 files changed
Lines changed: 36 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
110 | 143 | | |
111 | 144 | | |
112 | 145 | | |
| |||
0 commit comments