Bug 841809 - python-bugzilla fails to complete query
python-bugzilla fails to complete query
Product: Fedora EPEL
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: 2012-07-20 05:30 EDT by Steve Whitehouse
Modified: 2013-01-10 01:52 EST (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-12-30 17:11:13 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Shell script which runs python script (normally from cron) (89 bytes, application/x-shellscript)
2012-07-20 05:33 EDT, Steve Whitehouse
no flags Details
Python script (7.68 KB, application/octet-stream)
2012-07-20 05:35 EDT, Steve Whitehouse
no flags Details
changes to make bz.py work on bugzilla-0.7.0 (1.60 KB, patch)
2012-07-27 13:06 EDT, Don Zickus
no flags Details | Diff

  None (edit)
Description Steve Whitehouse 2012-07-20 05:30:29 EDT
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
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
  File "/usr/lib/python2.6/site-packages/bugzilla/rhbugzilla.py", line 413, in pre_translation
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 05:33:50 EDT
Created attachment 599344 [details]
Shell script which runs python script (normally from cron)
Comment 2 Steve Whitehouse 2012-07-20 05:35:39 EDT
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 13:04:28 EDT
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.

Comment 6 Don Zickus 2012-07-27 13:06:31 EDT
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.

Comment 7 Cole Robinson 2012-12-30 17:11:13 EST
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.

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