Directory restructuration
This commit is contained in:
parent
eb10288717
commit
b196905320
23 changed files with 127 additions and 166 deletions
12
easymapping/__init__.py
Normal file
12
easymapping/__init__.py
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
from jinja2 import Environment, FileSystemLoader
|
||||
|
||||
|
||||
class HaproxyConfigGenerator:
|
||||
def __init__(self, mapping):
|
||||
self.mapping = mapping
|
||||
|
||||
def generate(self):
|
||||
file_loader = FileSystemLoader('templates')
|
||||
env = Environment(loader=file_loader)
|
||||
template = env.get_template('haproxy.cfg.j2')
|
||||
return template.render(data=self.mapping)
|
||||
Loading…
Add table
Add a link
Reference in a new issue