- move scripts to assets/scripts (and updated build) - put most logic into HaproxyConfigGenerator - created DockerLabelHandler for all label handling from previous code - added unit tests and fixtures to cover HaproxyConfigGenerator and DockerLabelHandler - added a Makefile with build (for docker build) and test targets
16 lines
344 B
Python
16 lines
344 B
Python
import yaml
|
|
import sys
|
|
from easymapping import HaproxyConfigGenerator
|
|
|
|
if len(sys.argv) != 2:
|
|
print("You need to pass the easyconfig.yml path")
|
|
exit(1)
|
|
|
|
|
|
with open(sys.argv[1], 'r') as content_file:
|
|
parsed = yaml.load(content_file.read(), Loader=yaml.FullLoader)
|
|
|
|
cfg = HaproxyConfigGenerator(parsed)
|
|
print(cfg.generate())
|
|
|
|
exit(0)
|