Bug 981176

Summary: product has no key "components"
Product: [Fedora] Fedora Reporter: Lubos Kocman <lkocman>
Component: python-bugzillaAssignee: Will Woods <wwoods>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 19CC: bugs.michael, crobinso, dzickus, jskarvad, wwoods
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-07-09 22:58:56 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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.