Bug 981176 - product has no key "components"
product has no key "components"
Product: Fedora
Classification: Fedora
Component: python-bugzilla (Show other bugs)
Unspecified Unspecified
unspecified Severity high
: ---
: ---
Assigned To: Will Woods
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2013-07-04 04:09 EDT by Lubos Kocman
Modified: 2013-07-09 18:58 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-07-09 18:58:56 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Lubos Kocman 2013-07-04 04:09:01 EDT
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 05:20:53 EDT

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.

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

commit 7e268315db8fefc9723e2fdc903e5f6b13268be2
Author: Cole Robinson <crobinso@redhat.com>
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.