Skip to content

Commit 4ddbe20

Browse files
morrison12Fizzadar
authored andcommitted
documentation: fix files.block examples to use line
1 parent caa892c commit 4ddbe20

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pyinfra/operations/files.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1718,7 +1718,7 @@ def block(
17181718
path="/etc/hosts",
17191719
content="10.0.0.1 mars-one",
17201720
before=True,
1721-
regex=".*localhost",
1721+
line=".*localhost",
17221722
)
17231723
17241724
# have two entries in /etc/host
@@ -1727,7 +1727,7 @@ def block(
17271727
path="/etc/hosts",
17281728
content="10.0.0.1 mars-one\\n10.0.0.2 mars-two",
17291729
before=True,
1730-
regex=".*localhost",
1730+
line=".*localhost",
17311731
)
17321732
17331733
# remove marked entry from /etc/hosts
@@ -1742,7 +1742,7 @@ def block(
17421742
name="add out of date warning to web page",
17431743
path="/var/www/html/something.html",
17441744
content= "<p>Warning: this page is out of date.</p>",
1745-
regex=".*<body>.*",
1745+
line=".*<body>.*",
17461746
after=True
17471747
marker="<!-- {mark} PYINFRA BLOCK -->",
17481748
)

0 commit comments

Comments
 (0)