]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2225_statistics] remove 'else' statement
authorNaoki Kambe <kambe@jprs.co.jp>
Fri, 14 Dec 2012 08:45:47 +0000 (17:45 +0900)
committerNaoki Kambe <kambe@jprs.co.jp>
Tue, 8 Jan 2013 04:35:59 +0000 (13:35 +0900)
In stead of being removed, it just returns if DataNotFoundError is raised.

Due to the review comment.

src/lib/python/isc/statistics/counter.py

index 65b6a4dd0fbe8afc4394d4bce32795f06a091965..13d454163daa24279a66b3d85a824be64997601b 100644 (file)
@@ -337,19 +337,18 @@ class Counters():
                                               identifier)
             except isc.cc.data.DataNotFoundError:
                 # do not set the end time if the timer isn't started
-                pass
-            else:
-                # set the end time
-                _stop_timer(
-                    start_time,
-                    self._statistics._data,
-                    self._statistics._spec,
-                    identifier)
-                # delete the started timer
-                del isc.cc.data.find(
-                    self._start_time,
-                    _concat(*identifier.split('/')[0:-1]))\
-                    [identifier.split('/')[-1]]
+                return
+            # set the end time
+            _stop_timer(
+                start_time,
+                self._statistics._data,
+                self._statistics._spec,
+                identifier)
+            # delete the started timer
+            del isc.cc.data.find(
+                self._start_time,
+                _concat(*identifier.split('/')[0:-1]))\
+                [identifier.split('/')[-1]]
 
     def dump_statistics(self):
         """Calculates an entire server counts, and returns statistics