James - thanks for the patches. I've got most of this stuff fixed, but this one is interesting:
On Fri, 2011-01-14 at 16:00 -0500, James Laska wrote:
# Process output
results = {}
I was getting a traceback on line #146 (KeyError: 'ACCEPT') since the expected keys in results aren't initialized. I fixed it by replace the above line with:
results = dict(ACCEPT=list(), REJECT=list(), IGNORE=list())
data_re = re.compile('^(IGNORE|REJECT|ACCEPT): (.*)$')
for line in self.outputs.split('\n'):
match = data_re.match(line)
if not match:
continue
(what, builds) = match.groups()
results[what] = builds.split()
The depcheck output should *unconditionally* contain the lines:
"REJECT: [0 or more NVRs]" "ACCEPT: [0 or more NVRs]"
Which means the ACCEPT line should always match, which means results['ACCEPT'] should be initialized to [] (the result of ''.split()). So while it's a good idea to initialize results as you suggested.. something else has to have gone wrong there, because self.outputs does not contain the expected output. I wonder what happened?
-w