saltstack/salt — pull request #1563 by twinshadow (2012-07-02 05:46:24+00:00)
Title: module/interfaces.py: gathers and exposes network interface information

Currently, there are two modules for exposing the network interfaces depending on what platform is running. This seemed a little ineffecient, so I threw them together into a single module. It also gave me a chance to go through and clean-up a lot of the code for parsing the output from the "ip" and "ipconfig" commands. Multiple addresses gathered for each interface as well.

The goal is to have this module called from network.py and win_network.py, but I don't have the time or hardware to dedicate to this task, currently.

Also note the separation of the function from the command. I wanted to add some unit-tests with this commit as well, similar to what the following project is doing:
https://github.com/aaalex/ruby-ifconfig/tree/master/test