Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1430454

Summary: beaker-wizard doesn't work with python-bugzilla 2.0.0
Product: [Retired] Beaker Reporter: Cole Robinson <crobinso>
Component: command lineAssignee: beaker-dev-list
Status: CLOSED DUPLICATE QA Contact: tools-bugs <tools-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: developCC: dcallagh, mjia, rjoost
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-03-29 01:16:46 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 Cole Robinson 2017-03-08 15:57:47 UTC
beaker-wizard throws an error when used with python-bugzilla 2.0.0. From bug 1422524#5:

> $ beaker-wizard -b 1405238
> Contacting bugzilla...
> Fetching details for BZ#1405238
> Traceback (most recent call last):
>   File "/usr/bin/beaker-wizard", line 9, in <module>
>     load_entry_point('bkr.client==23.3', 'console_scripts',
> 'beaker-wizard')()
>   File "/usr/lib/python2.7/site-packages/bkr/client/wizard.py", line 3064,
> in main
>     test = Test(options)
>   File "/usr/lib/python2.7/site-packages/bkr/client/wizard.py", line 1130,
> in __init__
>     self.init()
>   File "/usr/lib/python2.7/site-packages/bkr/client/wizard.py", line 2734,
> in init
>     self.testname = Name(self.options)
>   File "/usr/lib/python2.7/site-packages/bkr/client/wizard.py", line 1130,
> in __init__
>     self.init()
>   File "/usr/lib/python2.7/site-packages/bkr/client/wizard.py", line 1941,
> in init
>     self.bugs.fetchBugDetails()
>   File "/usr/lib/python2.7/site-packages/bkr/client/wizard.py", line 1866,
> in fetchBugDetails
>     self.reproducers.find(self.bug)
>   File "/usr/lib/python2.7/site-packages/bkr/client/wizard.py", line 1992,
> in find
>     if not bug or not bug.attachments:
>   File "/usr/lib/python2.7/site-packages/bugzilla/bug.py", line 110, in
> __getattr__
>     raise AttributeError(msg)
> AttributeError: Bug object has no attribute 'attachments'.
> If 'attachments' is a bugzilla attribute, it may not have been cached when
> the bug was fetched. You may want to adjust your include_fields for
> getbug/query.


This is due to an intentional python-bugzilla API break in 2.0.0, described here in the top item :

http://blog.wikichoon.com/2016/06/python-bugzilla-api-changes-in-git.html

This change gets past the error for me, should work with older python-bugzilla too, and is faster to boot (one less bugzilla RPC call):

diff --git a/Client/src/bkr/client/wizard.py b/Client/src/bkr/client/wizard.py
index 03f3b6b..74386b2 100755
--- a/Client/src/bkr/client/wizard.py
+++ b/Client/src/bkr/client/wizard.py
@@ -1842,7 +1842,7 @@ def fetchBugDetails(self):
             # contact bugzilla and try to fetch the details
             try:
                 print "Fetching details for", self.showItem(self.data[0])
-                self.bug = self.options.bugzilla.getbug(bugid)
+                self.bug = self.options.bugzilla.getbug(bugid, extra_fields=["attachments"])
             except Exception, e:
                 if re.search('not authorized to access', str(e)):
                     print "Sorry, %s has a restricted access.\n"\

Comment 1 Dan Callaghan 2017-03-29 01:16:46 UTC

*** This bug has been marked as a duplicate of bug 1422385 ***