From 1645bca3aed66c2121fe6d8aaeea8405906723e2 Mon Sep 17 00:00:00 2001 From: Kristian Lyngstol Date: Mon, 7 Nov 2016 20:15:26 +0100 Subject: Scaffolding for functional templating :D --- templating/templating.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'templating/templating.py') diff --git a/templating/templating.py b/templating/templating.py index 47c886d..2c1259a 100755 --- a/templating/templating.py +++ b/templating/templating.py @@ -8,7 +8,7 @@ endpoints = "read/oplog read/snmp read/switches-management public/config public/ objects = dict() def getEndpoint(endpoint): - r = requests.get("http://localhost/api/%s" % endpoint, auth=('demo','demo')) + r = requests.get("http://gondul-front:/api/%s" % endpoint, auth=('demo','demo')) if (r.status_code != 200): raise Exception("Bad status code for endpoint %s: %s" % (endpoint, r.status_code)) return r.json() @@ -17,7 +17,7 @@ def updateData(): for a in endpoints: objects[a] = getEndpoint(a) -env = Environment(loader=FileSystemLoader('templates/')) +env = Environment(loader=FileSystemLoader(['templates/','/opt/gondul/templating/templates'])) import http.server class MyHandler(http.server.BaseHTTPRequestHandler): @@ -38,7 +38,7 @@ class MyHandler(http.server.BaseHTTPRequestHandler): self.wfile.flush() def run(server_class=http.server.HTTPServer, handler_class=http.server.BaseHTTPRequestHandler): - server_address = ('', 8000) + server_address = ('', 8080) httpd = server_class(server_address, handler_class) httpd.serve_forever() -- cgit v1.2.3