Moved the output to a served directory
This commit is contained in:
parent
af646bf797
commit
8e3796a69e
1 changed files with 2 additions and 2 deletions
|
@ -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')}))
|
||||
|
|
Reference in a new issue