summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2021-03-28 16:24:33 -0500
committerJohn Estabrook <jestabro@vyos.io>2021-03-28 16:24:33 -0500
commit889e16a77517549fb833a90d047455533be02f06 (patch)
tree3f790579b5a8775bbaf7f1ef848349ea21d136c0 /src
parentdb5a6cf0d32f4aad322fbf84bd074de52949a666 (diff)
downloadvyos-1x-889e16a77517549fb833a90d047455533be02f06.tar.gz
vyos-1x-889e16a77517549fb833a90d047455533be02f06.zip
http-api: T3440: give uvicorn time to initialize before starting Nginx
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/http-api.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/conf_mode/http-api.py b/src/conf_mode/http-api.py
index 472eb77e4..7e4b117c8 100755
--- a/src/conf_mode/http-api.py
+++ b/src/conf_mode/http-api.py
@@ -19,6 +19,7 @@
import sys
import os
import json
+import time
from copy import deepcopy
import vyos.defaults
@@ -34,11 +35,6 @@ config_file = '/etc/vyos/http-api.conf'
vyos_conf_scripts_dir=vyos.defaults.directories['conf_mode']
-# XXX: this model will need to be extended for tag nodes
-dependencies = [
- 'https.py',
-]
-
def get_config(config=None):
http_api = deepcopy(vyos.defaults.api_data)
x = http_api.get('api_keys')
@@ -103,8 +99,10 @@ def apply(http_api):
else:
call('systemctl stop vyos-http-api.service')
- for dep in dependencies:
- cmd(f'{vyos_conf_scripts_dir}/{dep}', raising=ConfigError)
+ # Let uvicorn settle before restarting Nginx
+ time.sleep(2)
+
+ cmd(f'{vyos_conf_scripts_dir}/https.py', raising=ConfigError)
if __name__ == '__main__':
try: