I don't know if this patch is the best solution, I would have to study the code longer, but it certainly fixes the traceback:
Traceback (most recent call last): File "/usr/bin/autoqa", line 166, in <module> testlist = hook.process_testlist(opts, args, testlist) File "/usr/share/autoqa/post-koji-build/hook.py", line 31, in process_testlist if 'x86_64' not in opts.arch and 'rpmlint' in testlist: TypeError: argument of type 'NoneType' is not iterable
opts.arch are not defined yet in that moment --- hooks/post-koji-build/hook.py | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/hooks/post-koji-build/hook.py b/hooks/post-koji-build/hook.py index 3cf9d92..298b098 100644 --- a/hooks/post-koji-build/hook.py +++ b/hooks/post-koji-build/hook.py @@ -26,7 +26,8 @@ def process_testlist(opts, args, testlist): # XXX TODO we may pull new tests from CVS at this point # XXX HACK: only run rpmlint on one single arch, since one test will cover # the packages for all arches - if 'x86_64' not in opts.arch and 'rpmlint' in testlist: + archs = opts.arch or [] + if 'x86_64' not in archs and 'rpmlint' in testlist: testlist.remove('rpmlint') return testlist
On Wed, 2009-12-02 at 14:33 +0100, Kamil Páral wrote:
I don't know if this patch is the best solution, I would have to study the code longer, but it certainly fixes the traceback:
Traceback (most recent call last): File "/usr/bin/autoqa", line 166, in <module> testlist = hook.process_testlist(opts, args, testlist) File "/usr/share/autoqa/post-koji-build/hook.py", line 31, in process_testlist if 'x86_64' not in opts.arch and 'rpmlint' in testlist: TypeError: argument of type 'NoneType' is not iterable
Ah - the problem here is that opts.arch is None instead of an empty list if no --arch flags are passed. Fixed by making opts.arch default to []:
-parser.add_option('-a', '--arch', action='append', +parser.add_option('-a', '--arch', action='append', default=[],
(that's commit ed12db2)
It might be a good idea to fix the option name so it's 'arches', to make it clear that it's supposed to be a list, but the arg is --arch so the default name was opts.arch. Oh well.
-w
autoqa-devel@lists.fedorahosted.org