Moved the output to a served directory

This commit is contained in:
Thomas Schwery 2015-11-07 13:54:21 +01:00
parent af646bf797
commit 8e3796a69e

View file

@ -16,7 +16,7 @@ from jinja2 import Template, BaseLoader, TemplateNotFound, FileSystemLoader, Env
# settings
config = {
'base_path': 'www/',
'base_path': '/var/www/html/saltstack/',
'template_path': 'templates/',
}
@ -54,7 +54,7 @@ class Inventorizer:
self.jobs_list = self.saltrun.cmd('jobs.list_jobs')
def createHostList(self):
fo = open(self.config['base_path'] + "hostlist.html", "wb")
fo = open(self.config['base_path'] + "index.html", "wb")
env = Environment(loader = FileSystemLoader(config['template_path']))
template = env.get_template('hostlist_template.html')
fo.write(template.render({'hostlist': self.host_list, 'statlist': self.stat_list, 'keylist': self.keys_list, 'joblist': self.jobs_list, 'now' : time.strftime('%Y-%m-%d %H:%M:%S')}))