summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/vyos/frr.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/python/vyos/frr.py b/python/vyos/frr.py
index ec0bef37a..668489636 100644
--- a/python/vyos/frr.py
+++ b/python/vyos/frr.py
@@ -68,6 +68,7 @@ Apply the new configuration:
import tempfile
import re
from vyos import util
+from vyos.util import chown
import logging
from logging.handlers import SysLogHandler
import os
@@ -220,8 +221,13 @@ def save_configuration(daemon=None):
if code:
raise OSError(code, output)
- with open(f"{path_config}/{daemon}.conf", "w") as f:
+ daemon_conf = f'{path_config}/{daemon}.conf'
+
+ with open(daemon_conf, "w") as f:
f.write(output)
+ # Set permissions (frr:frr) for /run/frr/{daemon}.conf
+ if os.path.exists(daemon_conf):
+ chown(daemon_conf, 'frr', 'frr')
config = output
return config