Changeset 13938 in genesis
- Timestamp:
- Jul 6, 2017, 9:14:20 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/gformat.py
r13937 r13938 124 124 nameservers_cache = [] 125 125 relations_cache = None 126 def clear_cache():127 ''' Poor mans cache implementation '''128 global datadump_cache, interface_list_cache, rc_conf_local_cache, ileiden_proxies, normal_proxies, nameservers_cache129 datadump_cache = {}130 interface_list_cache = {}131 rc_conf_local_cache = {}132 ileiden_proxies = OrderedDict()133 normal_proxies = []134 nameservers_cache = []135 relations_cache = None136 126 137 127 NO_DHCP = 0 … … 1505 1495 ('Refresh', '5; url=.'), 1506 1496 ] 1507 reload_cache()1508 1497 else: 1509 1498 base_uri = environ['REQUEST_URI'] … … 1813 1802 1814 1803 def print_cgi_response(response_headers, output): 1815 """Could we not use some kind of wsgi wrapper to make this output?"""1816 1804 for header in response_headers: 1817 1805 print "%s: %s" % header … … 1820 1808 1821 1809 1822 def fill_cache():1823 ''' Poor man re-loading of few cache items (the slow ones) '''1824 for host in get_hostlist():1825 get_yaml(host)1826 1827 1828 def reload_cache():1829 clear_cache()1830 fill_cache()1831 1832 1810 1833 1811 def main(): … … 2365 2343 print_cgi_response(response_headers, output) 2366 2344 2367 def application(environ, start_response):2368 status = '200 OK'2369 response_headers, output = process_cgi_request(environ)2370 start_response(status, response_headers)2371 2372 # Debugging only2373 # output = 'wsgi.multithread = %s' % repr(environ['wsgi.multithread'])2374 # soutput += '\nwsgi.multiprocess = %s' % repr(environ['wsgi.multiprocess'])2375 return [output]2376 2377 2345 if __name__ == "__main__": 2378 2346 main()
Note:
See TracChangeset
for help on using the changeset viewer.