Permalink
Browse files

Fix for procnettcp.py if IPv6 is disabled

If /proc/net/tcp6 doesn't exist, we die with:
procnettcp.py:     procfile.seek(0)
AttributeError: 'NoneType' object has no attribute 'seek'

Change-Id: I9127be78df8cf497cc8cbc25a857d5552bc03012
Reviewed-on: https://review.stumble.net/1952
Tested-by: Benoit Sigoure <tsuna@stumbleupon.com>
Reviewed-by: Benoit Sigoure <tsuna@stumbleupon.com>
  • Loading branch information...
1 parent 4fb6aae commit bcaed6dfceb210a4b1d2d911052490b97f45cda1 @davebarr davebarr committed with tsuna May 13, 2011
Showing with 2 additions and 0 deletions.
  1. +2 −0 collectors/0/procnettcp.py
@@ -194,6 +194,8 @@ def main(unused_args):
counter = {}
for procfile in (tcp, tcp6):
+ if procfile is None:
+ continue
procfile.seek(0)
ts = int(time.time())
for line in procfile:

0 comments on commit bcaed6d

Please sign in to comment.