Skip to content

Commit

Permalink
Fix for procnettcp.py if IPv6 is disabled
Browse files Browse the repository at this point in the history
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
Dave Barr authored and tsuna committed May 13, 2011
1 parent 4fb6aae commit bcaed6d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions collectors/0/procnettcp.py
Expand Up @@ -194,6 +194,8 @@ def main(unused_args):
counter = {} counter = {}


for procfile in (tcp, tcp6): for procfile in (tcp, tcp6):
if procfile is None:
continue
procfile.seek(0) procfile.seek(0)
ts = int(time.time()) ts = int(time.time())
for line in procfile: for line in procfile:
Expand Down

0 comments on commit bcaed6d

Please sign in to comment.