We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 652ebf7 commit 5311450Copy full SHA for 5311450
src/conf_mode/protocols_static.py
@@ -26,6 +26,7 @@
26
from vyos.frrender import FRRender
27
from vyos.frrender import get_frrender_dict
28
from vyos.utils.process import is_systemd_service_running
29
+from vyos.utils.file import write_file
30
from vyos.template import render
31
from vyos import ConfigError
32
from vyos import airbag
@@ -106,8 +107,7 @@ def generate(config_dict):
106
107
108
# Write the interface list for DHCP hooks or clean up if empty
109
if dhcp_interfaces:
- with open(DHCP_HOOK_IFLIST, 'w') as f:
110
- f.write(" ".join(dhcp_interfaces))
+ write_file(DHCP_HOOK_IFLIST, " ".join(dhcp_interfaces))
111
elif os.path.exists(DHCP_HOOK_IFLIST):
112
os.unlink(DHCP_HOOK_IFLIST)
113
0 commit comments