Bug 841809

Summary: python-bugzilla fails to complete query
Product: [Fedora] Fedora EPEL Reporter: Steve Whitehouse <swhiteho>
Component: python-bugzillaAssignee: Will Woods <wwoods>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: el6CC: crobinso, dcantrell, dzickus, nhosoi, nkinder, nstraz, rmeggins, sbradley, 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: 2012-12-30 22:11:13 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:
Attachments:
Description Flags
Shell script which runs python script (normally from cron)
none
Python script
none
changes to make bz.py work on bugzilla-0.7.0 none

Description Steve Whitehouse 2012-07-20 09:30:29 UTC
Description of problem:

My bug query script fails with the latest version of python-bugzilla

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

[swhiteho@sts-a ~]$ rpm -qi python-bugzilla
Name        : python-bugzilla              Relocations: (not relocatable)
Version     : 0.7.0                             Vendor: Fedora Project
Release     : 1.el6                         Build Date: Thu 14 Jun 2012 06:20:19 PM CDT
Install Date: Thu 19 Jul 2012 11:31:01 PM CDT      Build Host: x86-17.phx2.fedoraproject.org
Group       : Development/Languages         Source RPM: python-bugzilla-0.7.0-1.el6.src.rpm
Size        : 344191                           License: GPLv2+
Signature   : RSA/8, Thu 14 Jun 2012 06:42:54 PM CDT, Key ID 3b49df2a0608b895
Packager    : Fedora Project
URL         : https://fedorahosted.org/python-bugzilla
Summary     : A python library for interacting with Bugzilla
Description :
python-bugzilla is a python library for interacting with bugzilla instances
over XML-RPC. This package also includes the 'bugzilla' command-line tool
for interacting with bugzilla from shell scripts.


How reproducible:

Every time

Steps to Reproduce:
1. Run script
2.
3.
  
Actual results:

[swhiteho@sts-a ~]$ ./tasks.sh 
Traceback (most recent call last):
  File "/home/msp/swhiteho/bz.py", line 38, in <module>
    res = bz.query(q)
  File "/usr/lib/python2.6/site-packages/bugzilla/base.py", line 544, in query
    r = self._query(query)
  File "/usr/lib/python2.6/site-packages/bugzilla/rhbugzilla.py", line 573, in _query
    self.pre_translation(query)
  File "/usr/lib/python2.6/site-packages/bugzilla/rhbugzilla.py", line 413, in pre_translation
    include_fields.remove(oldname)
AttributeError: 'str' object has no attribute 'remove'


Expected results:

Script should complete normally.

Additional info:

This worked perfectly ok until this latest update.

Comment 1 Steve Whitehouse 2012-07-20 09:33:50 UTC
Created attachment 599344 [details]
Shell script which runs python script (normally from cron)

Comment 2 Steve Whitehouse 2012-07-20 09:35:39 UTC
Created attachment 599345 [details]
Python script

Note that this script needs editing to add your username and bugzilla password at the top of it, in order to make it work. For obvious reasons I removed my password and left an empty string there.

Comment 5 Don Zickus 2012-07-27 17:04:28 UTC
Hi Steve,

I fixed your script issues.  Basically there were two problems.

One the 'column_list' was a string instead of an array.  Not sure it worked on the old RH Bugzillas, but using an array always worked both old and new, so making that change would be recommended.

The second problem was the flag stuff.  The flag stuff changed in the new RH Bugzilla so it breaks your hardcoded flagtypes.name.  Just easier to grab a 'flags' field in the 'column_list' and parse directly.  I belive it gives the same results.

Anyway I will attach a patch that has the fixes for bz.py for you to review and apply.

Cheers,
Don

Comment 6 Don Zickus 2012-07-27 17:06:31 UTC
Created attachment 600834 [details]
changes to make bz.py work on bugzilla-0.7.0

This patch makes the script complete on my end.  Not sure the data is correct.

Cheers,
Don

Comment 7 Cole Robinson 2012-12-30 22:11:13 UTC
Given Don's recommended fixes, just closing this. If python-bugzilla was in the business of making all this back compat stuff continue to work we would be in a world of hurt given all the RHBZ changes going on.