diff --git a/syncthing_monitor/__main__.py b/syncthing_monitor/__main__.py index f0a76cd..12f5aad 100644 --- a/syncthing_monitor/__main__.py +++ b/syncthing_monitor/__main__.py @@ -2,8 +2,6 @@ import os import sys import time -from retrying import retry - import syncthing_monitor.config_xml as xml from .etcd_client import EtcdClient from .syncthing_client import SyncthingClient @@ -43,7 +41,6 @@ class SyncthingMonitor: self.syncthing_local_hostname = syncthing_local_hostname self.syncthing_config_xml_path = syncthing_config_xml_path - @retry def initialize_syncthing(self): api_key = xml.parse_api_key(self.syncthing_config_xml_path) print("Found API Key: {0}".format(api_key)) @@ -55,7 +52,6 @@ class SyncthingMonitor: self.syncthing = SyncthingClient(api_key, self.syncthing_local_hostname, self.syncthing_gui_port) - @retry def start(self): self.initialize_syncthing() diff --git a/syncthing_monitor/etcd_client.py b/syncthing_monitor/etcd_client.py index 51cfc09..f64524f 100644 --- a/syncthing_monitor/etcd_client.py +++ b/syncthing_monitor/etcd_client.py @@ -1,7 +1,6 @@ import json import etcd3 as etcd3 -from retrying import retry CLUSTER_INFO_KEY = '/syncthing_monitor/cluster_info' @@ -18,7 +17,6 @@ class EtcdClient: return {'devices': []} return json.loads(raw_value) - @retry def add_device_to_cluster(self, device_id, node_name, address): with self.etcd.lock('syncthing_monitor'): cluster_info = self.load_cluster_info() @@ -37,7 +35,6 @@ class EtcdClient: print("Updating etcd value for '{0}': {1}".format(self.key, json.dumps(cluster_info)), flush=True) self.etcd.put(self.key, json.dumps(cluster_info)) - @retry def get_device_list(self): device_list = self.load_cluster_info()['devices'] print("Obtained device_list devices from etcd: {0}".format(json.dumps(device_list)), flush=True) diff --git a/syncthing_monitor/syncthing_client.py b/syncthing_monitor/syncthing_client.py index 011df82..894253b 100644 --- a/syncthing_monitor/syncthing_client.py +++ b/syncthing_monitor/syncthing_client.py @@ -1,7 +1,6 @@ import json import requests -from retrying import retry class SyncthingClient: @@ -13,7 +12,6 @@ class SyncthingClient: self.headers = {'X-API-Key': self.api_key} self.myID = None - @retry def get_my_device_id(self): if self.myID is None: response = self.get("/rest/system/status") @@ -102,7 +100,6 @@ class SyncthingClient: response = self.post("/rest/config/folders", json.dumps(post_data)) print("Attempt to add shared folder to syncthing: {0}".format(response.content), flush=True) - @retry def print_config(self): response = self.get("/rest/config/devices") print("/rest/config/devices: {0}".format(response.content), flush=True) @@ -113,12 +110,10 @@ class SyncthingClient: response = self.get("/rest/config/options") print("/rest/config/options: {0}".format(response.content), flush=True) - @retry def config_is_in_sync(self): response = self.get("/rest/config/insync") return bool(json.loads(response.content)['configInSync']) - @retry def restart(self): response = self.post("/rest/system/restart", '') print("System reset: {0}".format(response.content), flush=True)