aboutsummaryrefslogtreecommitdiffstats
path: root/RRD.py
diff options
context:
space:
mode:
authorffki-rz root user <root@freifunk.in-kiel.de>2014-09-04 23:43:42 +0200
committerffki-rz root user <root@freifunk.in-kiel.de>2014-09-04 23:43:42 +0200
commit162b30f3a61958dbad4b4c4f9439b80082a33153 (patch)
treec72934f5fc5ce997da1359f7f23ddc2891c9fdf2 /RRD.py
parentc3cf5e4197dac6d469cd1e445b8d241d791c44f7 (diff)
parent65655a38bbd0773841d60285dc1c8758aaa17e61 (diff)
Merge remote-tracking branch 'ffnord/master'
Diffstat (limited to 'RRD.py')
-rw-r--r--RRD.py17
1 files changed, 5 insertions, 12 deletions
diff --git a/RRD.py b/RRD.py
index d1ae870..9bb87a0 100644
--- a/RRD.py
+++ b/RRD.py
@@ -80,9 +80,9 @@ class RRD:
raise FileNotFoundError(self.filename)
info = self.info()
if set(ds_list) - set(info['ds'].values()) != set():
- if set((ds.name, ds.type) for ds in ds_list) \
- - set((ds.name, ds.type) for ds in info['ds'].values()) != set():
- raise RRDIncompatibleException()
+ for ds in ds_list:
+ if ds.name in info['ds'] and ds.type != info['ds'][ds.name].type:
+ raise RRDIncompatibleException("%s is %s but should be %s" % (ds.name, ds.type, info['ds'][ds.name].type))
else:
raise RRDOutdatedException()
@@ -177,15 +177,8 @@ class RRD:
echo = True
dump.stdout.close()
restore.stdin.close()
- try:
- dump.wait(1)
- except subprocess.TimeoutExpired:
- dump.kill()
- try:
- restore.wait(2)
- except subprocess.TimeoutExpired:
- dump.kill()
- raise RuntimeError("rrdtool restore process killed")
+ dump.wait()
+ restore.wait()
os.rename(self.filename + ".new", self.filename)
self._cached_info = None