Fix: correct typo and existence test in fd getter
authorAntoine Busque <antoinebusque@gmail.com>
Wed, 15 Apr 2015 20:22:11 +0000 (16:22 -0400)
committerAntoine Busque <antoinebusque@gmail.com>
Wed, 15 Apr 2015 20:22:11 +0000 (16:22 -0400)
lttnganalyses/lttnganalyses/io.py

index d2de95dc4fd0d33dc55acbdd253c4049a350f369..30410b22bec665fb1bd95317981e49ef7d346746 100644 (file)
@@ -461,13 +461,13 @@ class ProcessIOStats():
             else:
                 if timestamp < fd_stats.open_ts:
                     return ProcessIOStats._get_fd_by_timestamp(
-                        fd_stats[:midpoint], timestamp)
+                        fd_list[:midpoint], timestamp)
                 else:
                     return ProcessIOStats._get_fd_by_timestamp(
-                        fd_stats[midpoint + 1:], timestamp)
+                        fd_list[midpoint + 1:], timestamp)
 
     def get_fd(self, fd, timestamp=None):
-        if not self.fds[fd]:
+        if fd not in self.fds or not self.fds[fd]:
             return None
 
         if timestamp is None:
This page took 0.032307 seconds and 5 git commands to generate.