pyfarm/pyfarm-core — pull request #23 by opalmer (2014-04-05 06:23:17+00:00)
Title: fix windows specific bugs in sysinfo.network

This change fixes some bugs in `pyfarm.core.sysinfo.network` on Windows. To be specific on Windows there's a major difference in how psutil and netifaces find and return network adapter names. On the one hand psutil uses the nic's nicename but netifaces uses the unique identifier (a GUID in the case of Windows). This resulted in several similiar errors in the tests:

```
======================================================================
ERROR: test_error_outgoing (test_system.Network)
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\buildslave\pyfarm-core\pyfarm-core-xp\build\tests\test_system.py", line 118, in test_error_outgoing
v = psutil.net_io_counters(pernic=True)[network.interface()].errout
KeyError: '{ED4F0CAD-A6FD-4767-8868-93DA2FC89DDF}'
```

Although this error was present in the tests it would have been a problem in the functions within network.py too and would have ended up creating some subtle bugs in other areas. This change has been tested on Windows 7 and XP and while it's not 100% comprehensive it's a lot better than it was before and provides some better error messages when it fails.