On Mar 12, 2009, at 11:03 AM, Michael DeHaan wrote:
If someone else has one handy and wants to hack on koan to see what's up with the networking code, I think it would be pretty easy.
I'd also welcome alternative implementations that don't use rhpl -- I'm trying to avoid parsing /sbin/ip if possible ... though we /may/ have to go back to that.
Note that the network code is used for both autodetection /AND/ the new registration feature. It's common.
I found the problem, but I'm not sure what the best solution is, so unfortunately I cannot offer a patch. In the get_network_info function ethtool.get_module(iname) throws an error in rhel 5.3 (rhpl-0.194.1-1), so the except clause is followed and continue skips the assignment of interfaces[iname]. I wasn't sure what would be the right was to fix it, so hopefully this info is still somewhat helpful.
def get_network_info(): try: import rhpl.ethtool as ethtool except: raise CX("the rhpl module is required to use this feature (is your OS>=EL3?)")
interfaces = {} # get names inames = ethtool.get_active_devices() for iname in inames: mac = ethtool.get_hwaddr(iname) ip = ethtool.get_ipaddr(iname) nm = ethtool.get_netmask(iname) try: module = ethtool.get_module(iname) if module == "bridge": continue except: continue interfaces[iname] = { "ip_address" : ip, "mac_address" : mac, "netmask" : nm }
return interfaces
[root@mint ~]# rpm -q rhpl rhpl-0.194.1-1
[root@mint ~]# python Python 2.4.3 (#1, Sep 17 2008, 16:07:08) [GCC 4.1.2 20071124 (Red Hat 4.1.2-41)] on linux2 Type "help", "copyright", "credits" or "license" for more information.
import rhpl.ethtool as ethtool ethtool.get_module('eth0')
Traceback (most recent call last): File "<stdin>", line 1, in ? IOError: [Errno 95] Operation not supported