Browse Source

Actuall write the config out.

pull/4/head
Chris Smith 8 years ago
parent
commit
78a9e3b467
1 changed files with 4 additions and 2 deletions
  1. 4
    2
      generate.py

+ 4
- 2
generate.py View File

@@ -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…
Cancel
Save