Commit 54ffdd8
committed
(MODULES-5651) Do not append infinitely
https://tickets.puppetlabs.com/browse/MODULES-5003 gave rise to
puppetlabs#788 and
puppetlabs#794 which caused
different behavior based on whether the line value was matched by the
match regex or not.
The change in behavior was both breaking and broken, though that was
hard to tell because the behavior was ill-described in general.
[bugfix] This commit resolves the breaking behavior by reverting the
behavior of "replacing matches when a line matching `line` exists even
when `multiple` is set to `true`".
[feature] This commit adds a new parameter to make file_line replace all
matches universally with the `line` value, even when the line exists
elsewhere in the file. This feature only affects modifying multiple
lines in a file when the `line` value already exists.
[bugfix] This commit more strictly defines the various interactions of
`ensure`, `match`, `append_on_no_match`, `replace`, `multiple`, and
`replace_all_matches_not_matching_line`. It also more clearly documents
and tests these interactions.1 parent 2339ea8 commit 54ffdd8
File tree
4 files changed
+555
-270
lines changed- lib/puppet
- provider/file_line
- type
- spec/unit/puppet/provider/file_line
4 files changed
+555
-270
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
222 | | - | |
| 222 | + | |
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
| |||
236 | 236 | | |
237 | 237 | | |
238 | 238 | | |
239 | | - | |
| 239 | + | |
240 | 240 | | |
241 | 241 | | |
242 | 242 | | |
| |||
261 | 261 | | |
262 | 262 | | |
263 | 263 | | |
264 | | - | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
265 | 267 | | |
266 | 268 | | |
267 | 269 | | |
268 | 270 | | |
269 | 271 | | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
270 | 278 | | |
271 | 279 | | |
272 | 280 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
19 | 41 | | |
20 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
21 | 59 | | |
22 | 60 | | |
23 | 61 | | |
| |||
68 | 106 | | |
69 | 107 | | |
70 | 108 | | |
71 | | - | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
72 | 116 | | |
73 | 117 | | |
74 | 118 | | |
| |||
140 | 184 | | |
141 | 185 | | |
142 | 186 | | |
| 187 | + | |
143 | 188 | | |
144 | | - | |
| 189 | + | |
145 | 190 | | |
146 | 191 | | |
147 | 192 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
154 | 161 | | |
155 | 162 | | |
156 | 163 | | |
| |||
168 | 175 | | |
169 | 176 | | |
170 | 177 | | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
171 | 184 | | |
172 | 185 | | |
173 | 186 | | |
| |||
0 commit comments