Bug 158723

Summary: 2 bugs in inf2mondb.py
Product: [Fedora] Fedora Reporter: Fred New <fred.new2911>
Component: hwdataAssignee: Phil Knirsch <pknirsch>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: laroche, mattdm, matt_domsch, rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-07-18 12:37:46 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 150221    
Attachments:
Description Flags
New version of script
none
Possible enhancement to script.
none
Possible script enhancement, version 2
none
inf2mondb.py none

Description Fred New 2005-05-25 08:31:10 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050513 Fedora/1.0.4-1.3.1 Firefox/1.0.4

Description of problem:
The Windows XP monitor.inf file has two irregularities that cause inf2mondb.py
to crash.  First, I see this message:

$ inf2mondb.py monitor.inf
Traceback (most recent call last):
  File "/home/fred/bin/inf2mondb.py", line 163, in ?
    sync = string.split(modes[3], ',')
IndexError: list index out of range
$

If I fix inf2mondb.py to get around this problem, I get the following error:

$ inf2mondb.py monitor.inf
Bridge Information Co.,Ltd; Bridge BM17C; BRG00AB; 30.0-70.0; 50.0-160.0
<snip>
(Standard monitor types); Standard VGA 640x480; MS_0640; ;
Traceback (most recent call last):
  File "/home/fred/bin/inf2mondb.py", line 170, in ?
    for monitor in monitors[man].values():
KeyError: 'applem'
$

Version-Release number of selected component (if applicable):
hwdata-0.145-1

How reproducible:
Always

Steps to Reproduce:
1. inf2mondb.py monitor.inf  # Monitor .inf file from Windows XP
 

Actual Results:  I get the error messages above.

Expected Results:  Successful running of the script with no error messages.

Additional info:

Comment 1 Fred New 2005-05-25 08:33:50 UTC
Created attachment 114816 [details]
New version of script

My patched version of the script.

Comment 2 Fred New 2005-05-25 08:42:47 UTC
Created attachment 114817 [details]
Possible enhancement to script.

This version of the script looks in MonitorsDB and displays entries that don't
already exist.	It may be possible to write the script to work the old way and
my
new way depending on parameters, but I'm not a power Python programmer, yet.

Comment 3 Fred New 2005-05-27 12:46:27 UTC
Created attachment 114910 [details]
Possible script enhancement, version 2

Added parameters --new, --verbose and --database.

Comment 4 Phil Knirsch 2006-02-01 16:33:23 UTC
Interessting script. I'll take a closer look at it, maybe even put it in as long
as it provides by default the same behaviour as the old script.

Read ya, Phil

Comment 5 Fred New 2006-02-02 12:26:39 UTC
If you keep my enhancements, feel free to change the parameters to more
meaningful names.  Particularly the "--new" parameter - I couldn't think of a
more descriptive word for what I was trying to do.

Comment 6 Phil Knirsch 2006-02-02 12:59:16 UTC
The parameters sound fine to me, --new could be renamed to --diff, but i don't
think thats necessary as long as the help provides some info what --new does. :) 

I've just tested it, there is still a small bug: If you specify a monitor.inf
file and check the output all monitor entries will have the same EISA ID. I
tried it with several .inf files and always got that problem. Without having
looked at the code closer yet i suspect it's because of some hash lookup where
the correlation between a monitor entry in the .inf file and it's EISA number
somehow gets lost and only the 1st entry will be picked.

Will look at code some more and see if i can find the problem. Otherwise really
helpful as i can easily check a new .inf file against the current MonitorsDB and
see whats supposedly new.

Read ya, Phil

Comment 7 Matt Domsch 2006-02-16 16:43:02 UTC
Created attachment 124766 [details]
inf2mondb.py

the attached version is essentially a complete rewrite of the ini parsing,
using ConfigParser.  It successfully parses all the monitor*.inf files from
Windows XP, as well as all the monitor files posted on ftp.dell.com/monitors/. 
Using this version, I found 15 monitors that Dell has posted but that aren't in
any published MonitorDB files, where using the previous versions, I only found
2. :-)

Comment 9 Phil Knirsch 2006-05-10 13:53:55 UTC
Using that script internally atm. If it proves to be working for all files i get
my hands on i'll probably replace the old in in the near future.

Read ya, Phil

Comment 10 Matthew Miller 2006-07-10 22:23:39 UTC
Fedora Core 3 is now maintained by the Fedora Legacy project for security
updates only. If this problem is a security issue, please reopen and
reassign to the Fedora Legacy product. If it is not a security issue and
hasn't been resolved in the current FC5 updates or in the FC6 test
release, reopen and change the version to match.

Thank you!


Comment 11 Matt Domsch 2006-07-10 22:32:42 UTC
Updating bug to -devel as it's not addressed in FC6.

Comment 12 Phil Knirsch 2006-07-18 12:37:46 UTC
I've included your new inf2mondb.py now in the Fedora Devel package as it worked
flawless so far and the code looks ok. Will be in next hwdata package in rawhide.

Read ya, Phil