saltstack/salt — pull request #2913 by archtaku (2012-12-16 02:46:49+00:00)
Title: Add "interface" option to network.ip_addrs{,6}

This commit adds an optional "interface" argument to both functions,
allowing one to return a list of IPs belonging to a specific interface,
instead of all IPs.

Also, I discovered and fixed a bug with the way that the "ip" command
was being parsed. The private function _interfaces_ip() accepts the
output of two shell commands: 'ip link show' and 'ip addr show'.
However, because cmd.run appears to strip the final newline from the
results (this might actually be done by subprocess.Popen.communicate(),
I haven't looked too closely), this results in the output from the
second command starting on the same line as the output from the first
command, which interferes with the regex used to parse the output.