Bug 981176 - product has no key "components"
Summary: product has no key "components"
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: python-bugzilla
Version: 19
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
Assignee: Will Woods
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-07-04 08:09 UTC by Lubos Kocman
Modified: 2013-07-09 22:58 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-07-09 22:58:56 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Lubos Kocman 2013-07-04 08:09:01 UTC
Description of problem:

  File "/usr/lib/python2.7/site-packages/bugzilla/base.py", line 693, in _getcomponentsdetails
    comps = p["components"]
KeyError: 'components'



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

used against bugzilla.redhat.com

How reproducible:

Steps to Reproduce:
1. session.getcomponentsdetails(product="Red Hat Developer Toolset") #in my case

Actual results:

  File "/usr/lib/python2.7/site-packages/bugzilla/base.py", line 553, in getcomponentsdetails
    clist = self._getcomponentsdetails(product)
  File "/usr/lib/python2.7/site-packages/bugzilla/base.py", line 693, in _getcomponentsdetails
    comps = p["components"]
KeyError: 'components'


the dict actually contains only ("id", "name") keys. The Comment in code says that features should be supported since bugzilla 4.2 (rhbz is 4.4)

Expected results:


Additional info:

Comment 1 Lubos Kocman 2013-07-04 09:20:53 UTC
Hello,

I've realized that I have to refresh data manually in order to access them:

session.refresh_products(names=[product,], include_fields=["name", "id", "components",])  


Probably notabug, but I believe it's worth some better exception handling or force refreshing requested data.

I'll leave it up2 you.

Lubos

Comment 2 Cole Robinson 2013-07-09 22:58:56 UTC
Thanks for the report Lubos. I agree we should try a refresh here, I pushed this:

commit 7e268315db8fefc9723e2fdc903e5f6b13268be2
Author: Cole Robinson <crobinso>
Date:   Tue Jul 9 18:57:04 2013 -0400

    base: getcomponentsdetails: Try a refresh if data isn't cached


Just closing this since it's a minor issue that isn't worth doing an explicit backport/build/update for.


Note You need to log in before you can comment on or make changes to this bug.