kiranvizru / psutil

Automatically exported from code.google.com/p/psutil
Other
0 stars 0 forks source link

interfaces with ':' in name break network_io_counters #435

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Following line in /proc/net/dev breaks psutil:
'bond0:1: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n'

Original issue reported on code.google.com by john.pan...@gmail.com on 25 Sep 2013 at 7:26

GoogleCodeExporter commented 9 years ago
Solution:

_pslinux.py

-colon = line.find(':')
+colon = line.find(': ')

Original comment by john.pan...@gmail.com on 25 Sep 2013 at 7:27

GoogleCodeExporter commented 9 years ago
Do you actually have an interface with that name ("bond0:1") or this is just 
for  extra carefulness?
Regardless, I fixed this in revision 32524621022e.

Original comment by g.rodola on 25 Sep 2013 at 7:41

GoogleCodeExporter commented 9 years ago
Yes, this is a real case: https://github.com/Eugeny/ajenti/issues/150. Thanks 
for the update!

Original comment by john.pan...@gmail.com on 25 Sep 2013 at 7:43

GoogleCodeExporter commented 9 years ago
Just found out this doesn't always work. E.g. on Ubuntu 12.04 server, there's 
no space after the colon. Changing find(': ') to rfind(':') should help.

Original comment by john.pan...@gmail.com on 25 Sep 2013 at 1:42

GoogleCodeExporter commented 9 years ago
Right, thanks. Done.

Original comment by g.rodola on 25 Sep 2013 at 1:59

GoogleCodeExporter commented 9 years ago

Original comment by g.rodola on 28 Sep 2013 at 10:06

GoogleCodeExporter commented 9 years ago
Closing out as fixed. Release 1.1.0 is now available for download.

Original comment by g.rodola on 28 Sep 2013 at 5:32