added debug logging

This commit is contained in:
B.J. Dweck 2021-02-02 10:48:19 +02:00
parent 728f35b52c
commit cd646e2089
2 changed files with 3 additions and 0 deletions

View File

@ -67,7 +67,9 @@ class SyncthingMonitor:
[{'id': self.my_device_id}])
self.syncthing.sync_config()
print("Registering etcd update callback...", flush=True)
self.etcd.register_device_update_handler(self.update_devices)
print("Attempting to add this device to etcd...", flush=True)
self.etcd.add_device_to_cluster(self.my_device_id, self.syncthing_node_name, self.syncthing_publish_address)
self.loop()

View File

@ -12,6 +12,7 @@ class EtcdClient:
self.key = key
def load_cluster_info(self):
print("Retrieving cluster info from etcd...", flush=True)
raw_value = self.etcd.get(self.key)[0]
if raw_value is None:
return {'devices': []}