ftao/python-ifcfg — pull request #1 by hstern (2014-01-30 14:55:06+00:00)
Title: ifcfg/parser: fix failure if ifconfig is not in $PATH

This module does not work if ifconfig is not in the user's $PATH. Here is a patch to fix it.

>>> import ifcfg
>>> print ifcfg.interfaces()
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python2.7/dist-packages/ifcfg-0.9.1-py2.7.egg/ifcfg/__init__.py", line 57, in interfaces
parser = get_parser()
File "/usr/local/lib/python2.7/dist-packages/ifcfg-0.9.1-py2.7.egg/ifcfg/__init__.py", line 41, in get_parser
parser = LinuxParser(ifconfig=ifconfig)
File "/usr/local/lib/python2.7/dist-packages/ifcfg-0.9.1-py2.7.egg/ifcfg/parser.py", line 160, in __init__
super(Linux2Parser, self).__init__(*args, **kw)
File "/usr/local/lib/python2.7/dist-packages/ifcfg-0.9.1-py2.7.egg/ifcfg/parser.py", line 153, in __init__
super(LinuxParser, self).__init__(*args, **kw)
File "/usr/local/lib/python2.7/dist-packages/ifcfg-0.9.1-py2.7.egg/ifcfg/parser.py", line 135, in __init__
super(UnixParser, self).__init__(*args, **kw)
File "/usr/local/lib/python2.7/dist-packages/ifcfg-0.9.1-py2.7.egg/ifcfg/parser.py", line 30, in __init__
self.parse(self.ifconfig_data)
File "/usr/local/lib/python2.7/dist-packages/ifcfg-0.9.1-py2.7.egg/ifcfg/parser.py", line 48, in parse
ifconfig, err, retcode = exec_cmd(self._meta.ifconfig_cmd_args)
File "/usr/local/lib/python2.7/dist-packages/ifcfg-0.9.1-py2.7.egg/ifcfg/tools.py", line 20, in exec_cmd
proc = Popen(cmd_args, stdout=PIPE, stderr=PIPE)
File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1259, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory