Skip to content

Commit 5311450

Browse files
committed
T3680: protocols: use vyos.utils.write_file()
1 parent 652ebf7 commit 5311450

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/conf_mode/protocols_static.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
from vyos.frrender import FRRender
2727
from vyos.frrender import get_frrender_dict
2828
from vyos.utils.process import is_systemd_service_running
29+
from vyos.utils.file import write_file
2930
from vyos.template import render
3031
from vyos import ConfigError
3132
from vyos import airbag
@@ -106,8 +107,7 @@ def generate(config_dict):
106107

107108
# Write the interface list for DHCP hooks or clean up if empty
108109
if dhcp_interfaces:
109-
with open(DHCP_HOOK_IFLIST, 'w') as f:
110-
f.write(" ".join(dhcp_interfaces))
110+
write_file(DHCP_HOOK_IFLIST, " ".join(dhcp_interfaces))
111111
elif os.path.exists(DHCP_HOOK_IFLIST):
112112
os.unlink(DHCP_HOOK_IFLIST)
113113

0 commit comments

Comments
 (0)