Skip to content

Commit 18e55ea

Browse files
committed
Update files.line/files.replace operations for new interpolate variables kwarg.
1 parent 38528c9 commit 18e55ea

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

pyinfra/operations/files.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,11 @@ def line(
360360

361361
host.create_fact(
362362
FindInFile,
363-
kwargs={'path': path, 'pattern': match_line},
363+
kwargs={
364+
'path': path,
365+
'pattern': match_line,
366+
'interpolate_variables': interpolate_variables,
367+
},
364368
data=[replace or line],
365369
)
366370

@@ -375,7 +379,11 @@ def line(
375379

376380
host.delete_fact(
377381
FindInFile,
378-
kwargs={'path': path, 'pattern': match_line},
382+
kwargs={
383+
'path': path,
384+
'pattern': match_line,
385+
'interpolate_variables': interpolate_variables,
386+
},
379387
)
380388

381389
# Line(s) exists and we have want to ensure they're correct
@@ -441,7 +449,11 @@ def replace(
441449
)
442450
host.create_fact(
443451
FindInFile,
444-
kwargs={'path': path, 'pattern': match},
452+
kwargs={
453+
'path': path,
454+
'pattern': match,
455+
'interpolate_variables': interpolate_variables,
456+
},
445457
data=[],
446458
)
447459
else:

0 commit comments

Comments
 (0)