Description of problem: % bodhi -T Traceback (most recent call last): File "/usr/bin/bodhi", line 313, in <module> main() File "/usr/bin/bodhi", line 219, in main log.info(bodhi.update_str(update, minimal=opts.verbose)) File "/usr/lib/python2.5/site-packages/fedora/client/bodhi.py", line 311, in update_str if update['updateid']: File "/usr/lib/python2.5/site-packages/fedora/client/__init__.py", line 93, in __getitem__ value = super(DictContainer, self).__getitem__(key) KeyError: 'updateid' ...if I fix that (with 'updateid' in update) it just fails on 'release' a few lines later. Not sure if this is bodhi or python-fedora... Version-Release number of selected component (if applicable): Installed Packages bodhi-client.noarch 0.5.3-1.fc9 installed python-fedora.noarch 0.3.6-2.fc9 installed How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info:
It's a bodhi bug. the bodhi command line client is sending in the raw results from having called the bodhi.list() method earlier. It needs to do something more like this:: results = bodhi.list([...]) for update in results['updates']: bodhi.update_str(update) Looking for the problem code now.
Created attachment 324111 [details] Change testable() to return one package at a time Patch for /usr/lib/python2.5/site-packages/fedora/client/bodhi.py
Just to eat my words, I discovered that this could be fixed either in the bodhi client or in python-fedora. The attached patch fixes it in python-fedora which I am slightly leaning towards as the right place. Of course, this does change the API of bodhi.testable() :-( Luke, if you think this is right, I'll commit it and spin a new python-fedora package soon. If you'd rather fix it in bodhi client, it's this: https://fedorahosted.org/bodhi/browser/bodhi/tools/client.py#L212 elif opts.testable: for update in bodhi.testable(): log.info(bodhi.update_str(update, minimal=opts.verbose)) this would have to change to something like this:: elif opts.testable: for update in bodhi.testable()['updates']: log.info(bodhi.update_str(update, minimal=opts.verbose))
The BodhiClient.testable method currently yields BaseClient.send_request responses, where as the majority of the API returns a single response. The only other generator is BodhiClient.candidates, and that yields builds. So, to be semi-consistent with the inconsistencies of the existing API, I'd say your patch is the way to go. The bodhi-client is a complete mess as it is, so lets do it right in python-fedora. Thanks!
python-fedora-0.3.8-1.fc10 has been submitted as an update for Fedora 10. http://admin.fedoraproject.org/updates/python-fedora-0.3.8-1.fc10
python-fedora-0.3.8-1.fc10 has been pushed to the Fedora 10 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with su -c 'yum --enablerepo=updates-testing update python-fedora'. You can provide feedback for this update here: http://admin.fedoraproject.org/updates/f10/FEDORA-2008-9881
Note: I've discovered a bug in our patches to NSS in curl that causes bodhi -T to fail. bodhi -T with this version of python-fedora will work on EL-5. I have a bug open and a patch to curl: https://bugzilla.redhat.com/show_bug.cgi?id=472489 Failing that, I have a dirty workaround that initializes curl before anything else utilizes libnss. We can add this code to the bodhi-client if we must:: # Authors: Luke Macken <lmacken> import pycurl c = pycurl.Curl() c.setopt(pycurl.WRITEDATA, open('/dev/null', 'w')) c.setopt(pycurl.URL, 'https://admin.fedoraproject.org/') c.perform() import sys
python-fedora-0.3.8-1.fc10 has been pushed to the Fedora 10 stable repository. If problems still persist, please make note of it in this bug report.