Fix bin/NIC parsing for PCI ID lookup
authorStefan Hajnoczi <stefanha@gmail.com>
Sat, 20 Mar 2010 05:15:57 +0000 (05:15 +0000)
committerStefan Hajnoczi <stefanha@gmail.com>
Sat, 20 Mar 2010 05:15:57 +0000 (05:15 +0000)
cmds.py

diff --git a/cmds.py b/cmds.py
index a7bd995..82defdf 100644 (file)
--- a/cmds.py
+++ b/cmds.py
@@ -106,10 +106,10 @@ def lspci_command(who, _, replyto, words):
 
     try:
         for line in open(config.NICFILE):
 
     try:
         for line in open(config.NICFILE):
-            line = line.strip()
+            line = line.rstrip('\r\n')
             if not line or line.startswith('#'):
                 continue
             if not line or line.startswith('#'):
                 continue
-            fields = line.split()
+            fields = line.split('\t')
 
             if fields[0] == 'family':
                 driver = fields[1].split('/')[-1]
 
             if fields[0] == 'family':
                 driver = fields[1].split('/')[-1]