소스 검색

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()

Loading…
취소
저장