Skip to content

Commit b514fc6

Browse files
committed
Update files.line/files.replace operations for new interpolate variables kwarg.
1 parent 60c61dc commit b514fc6

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
@@ -368,7 +368,11 @@ def line(
368368

369369
host.create_fact(
370370
FindInFile,
371-
kwargs={'path': path, 'pattern': match_line},
371+
kwargs={
372+
'path': path,
373+
'pattern': match_line,
374+
'interpolate_variables': interpolate_variables,
375+
},
372376
data=[replace or line],
373377
)
374378

@@ -383,7 +387,11 @@ def line(
383387

384388
host.delete_fact(
385389
FindInFile,
386-
kwargs={'path': path, 'pattern': match_line},
390+
kwargs={
391+
'path': path,
392+
'pattern': match_line,
393+
'interpolate_variables': interpolate_variables,
394+
},
387395
)
388396

389397
# Line(s) exists and we have want to ensure they're correct
@@ -449,7 +457,11 @@ def replace(
449457
)
450458
host.create_fact(
451459
FindInFile,
452-
kwargs={'path': path, 'pattern': match},
460+
kwargs={
461+
'path': path,
462+
'pattern': match,
463+
'interpolate_variables': interpolate_variables,
464+
},
453465
data=[],
454466
)
455467
else:

0 commit comments

Comments
 (0)