Browse Source

Ignore labels without values

master
Chris Smith 8 years ago
parent
commit
ac8892b869
1 changed files with 3 additions and 2 deletions
  1. 3
    2
      generate.py

+ 3
- 2
generate.py View File

@@ -17,8 +17,9 @@ fetcher = etcdlib.Connection(args.etcd_host, args.etcd_port, args.etcd_prefix)
17 17
 while True:
18 18
   domains = defaultdict(set)
19 19
   for container, values in fetcher.get_label('com.chameth.vhost').items():
20
-    parts = values.split(',')
21
-    domains[parts[0].strip()] |= set([] if len(parts) == 1 else parts[1:])
20
+    if values:
21
+      parts = values.split(',')
22
+      domains[parts[0].strip()] |= set([] if len(parts) == 1 else parts[1:])
22 23
 
23 24
   with open('/letsencrypt/domains.txt.new', 'w') as f:
24 25
     print('Writing domains.txt...')

Loading…
Cancel
Save