summaryrefslogtreecommitdiff
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:56 +0200
commit9e1cbaa5f8943221caf4ce4fd3bebc3fec8dc49a (patch)
treee23f4b24e70d0dd645adb871a1e94908d0a27c1b
parent35dcd0a1cb5d9a63dbebcb299eb9425b57258537 (diff)
downloadvyos-1x-9e1cbaa5f8943221caf4ce4fd3bebc3fec8dc49a.tar.gz
vyos-1x-9e1cbaa5f8943221caf4ce4fd3bebc3fec8dc49a.zip
[service https] T1443: create /etc/vyos if it doesn't exist.
-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)