summaryrefslogtreecommitdiff
path: root/src/conf_mode/vrrp.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/conf_mode/vrrp.py')
-rwxr-xr-xsrc/conf_mode/vrrp.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/conf_mode/vrrp.py b/src/conf_mode/vrrp.py
index 2ece792dc..f11dce879 100755
--- a/src/conf_mode/vrrp.py
+++ b/src/conf_mode/vrrp.py
@@ -30,6 +30,7 @@ import vyos.config
from vyos import ConfigError
from vyos.util import call
+from vyos.util import makedir
from vyos.template import render
from vyos.ifconfig.vrrp import VRRP
@@ -136,7 +137,9 @@ def get_config(config=None):
sync_groups.append(sync_group)
# create a file with dict with proposed configuration
- with open("{}.temp".format(VRRP.location['vyos']), 'w') as dict_file:
+ dirname = os.path.dirname(VRRP.location['vyos'])
+ makedir(dirname)
+ with open(VRRP.location['vyos'] + ".temp", 'w') as dict_file:
dict_file.write(dumps({'vrrp_groups': vrrp_groups, 'sync_groups': sync_groups}))
return (vrrp_groups, sync_groups)