summaryrefslogtreecommitdiff
path: root/src/conf_mode/http-api.py
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2021-03-28 16:24:33 -0500
committerJohn Estabrook <jestabro@vyos.io>2021-11-07 15:21:50 -0600
commit7a85ac845fe5f88cf72472650c371e3fad03941a (patch)
treece58a960c13309b531feea638cdf9225c6168efd /src/conf_mode/http-api.py
parent9756b870d503eab00714b21c66bf30de47878f6e (diff)
downloadvyos-1x-7a85ac845fe5f88cf72472650c371e3fad03941a.tar.gz
vyos-1x-7a85ac845fe5f88cf72472650c371e3fad03941a.zip
http-api: T3440: give uvicorn time to initialize before starting Nginx
(cherry picked from commit 889e16a77517549fb833a90d047455533be02f06)
Diffstat (limited to 'src/conf_mode/http-api.py')
-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: