You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kibble.apache.org by hu...@apache.org on 2018/09/13 15:13:12 UTC
[kibble] 03/03: Don't require DB connection for API doc printing
This is an automated email from the ASF dual-hosted git repository.
humbedooh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kibble.git
commit c3c89044bbb44092551a5bad54015f4d48ded2cd
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Thu Sep 13 17:12:31 2018 +0200
Don't require DB connection for API doc printing
---
api/handler.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/api/handler.py b/api/handler.py
index 82485a7..d767e69 100644
--- a/api/handler.py
+++ b/api/handler.py
@@ -47,7 +47,7 @@ if __name__ != '__main__':
config = yaml.load(open("yaml/kibble.yaml"))
# Instantiate database connections
-DB = plugins.database.KibbleDatabase(config)
+DB = None
# Load Open API specifications
KibbleOpenAPI = plugins.openapi.OpenAPI("yaml/openapi.yaml")
@@ -159,6 +159,7 @@ def application(environ, start_response):
Checks against the pages library, and if submod found, runs
it and returns the output.
"""
+ DB = plugins.database.KibbleDatabase(config)
path = environ.get('PATH_INFO', '')
for regex, function in urls:
m = re.match(regex, path)