浏览代码

Actuall write the config out.

pull/4/head
Chris Smith 8 年前
父节点
当前提交
78a9e3b467
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4
    2
      generate.py

+ 4
- 2
generate.py 查看文件

@@ -1,6 +1,5 @@
1 1
 #!/usr/bin/env python3
2 2
 
3
-from collections import defaultdict
4 3
 import argparse
5 4
 import etcdlib
6 5
 import jinja2
@@ -34,7 +33,10 @@ while True:
34 33
       'certificate_key': args.cert_key_path % domains[container][0]
35 34
     })
36 35
 
37
-  print(template.render(services=services)) # TODO: Actually write it out
36
+  with open('/nginx-config/vhosts.conf', 'w') as f:
37
+    print('Writing vhosts.conf...', flush=True)
38
+    f.write(template.render(services=services))
39
+
38 40
   print('Done writing config.', flush=True)
39 41
 
40 42
   fetcher.wait_for_update()

正在加载...
取消
保存