comparison service/arduinoNode/pushConfig.py @ 456:12f9f1838fb5

arduinoNode: build updates, stats support, etc Ignore-this: 39386eb7644e3cf522e0f72a874eadba
author drewp@bigasterisk.com
date Sat, 20 Apr 2019 23:28:29 -0700
parents 13b2a61650c1
children 048a8df60e2e
comparison
equal deleted inserted replaced
455:7e09c0d0a86e 456:12f9f1838fb5
2 import sys 2 import sys
3 import etcd3 3 import etcd3
4 4
5 from twisted.python.filepath import FilePath 5 from twisted.python.filepath import FilePath
6 6
7 etcd = etcd3.client(host='bang6') 7 etcd = etcd3.client(host='bang6', port=9022)
8 8
9 prefix, = sys.argv[1:] 9 prefix, = sys.argv[1:]
10 10
11 def main(): 11 def main():
12 existing = set(md.key for v, md in etcd.get_prefix(prefix)) 12 existing = set(md.key for v, md in etcd.get_prefix(prefix))
13 written = set() 13 written = set()
14 root = FilePath('config') 14 root = FilePath('config')
15 print 'reading at %s' % root
15 for f in root.walk(): 16 for f in root.walk():
16 if f.isfile() and f.path.endswith('.n3'): 17 if f.isfile() and f.path.endswith('.n3'):
17 n3 = f.getContent() 18 n3 = f.getContent()
18 key = prefix + b'/'.join(f.segmentsFrom(root)) 19 key = prefix + b'/'.join(f.segmentsFrom(root))
19 etcd.put(key, n3) 20 etcd.put(key, n3)