summaryrefslogtreecommitdiff
path: root/src/conf_mode/http-api.py
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2019-09-04 16:03:15 +0200
committerDaniil Baturin <daniil@baturin.org>2019-09-04 16:03:15 +0200
commitbc8a1218bae92320b93093cadbc8390b52a46204 (patch)
treea4af0c508224ea5b26a8422e1b071536e0e286c8 /src/conf_mode/http-api.py
parent4d50edfc9543f3d27eb83300dd27d598ffe63fe2 (diff)
downloadvyos-1x-bc8a1218bae92320b93093cadbc8390b52a46204.tar.gz
vyos-1x-bc8a1218bae92320b93093cadbc8390b52a46204.zip
[service https] T1443: create /etc/vyos if it doesn't exist.
Diffstat (limited to 'src/conf_mode/http-api.py')
-rwxr-xr-xsrc/conf_mode/http-api.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/conf_mode/http-api.py b/src/conf_mode/http-api.py
index 1f91ac582..9c062f0aa 100755
--- a/src/conf_mode/http-api.py
+++ b/src/conf_mode/http-api.py
@@ -69,6 +69,9 @@ def generate(http_api):
if http_api is None:
return None
+ if not os.path.exists('/etc/vyos'):
+ os.mkdir('/etc/vyos')
+
with open(config_file, 'w') as f:
json.dump(http_api, f, indent=2)