[python-bugzilla] Problem with RHBugzilla and _add_field_alias

Cole Robinson crobinso at redhat.com
Sat Nov 29 19:31:30 UTC 2014


On 11/28/2014 09:22 PM, Jason L Tibbitts III wrote:
> I'm kind of stumped on this one.  I have a bit of code in Fedora
> infrastructure (so running on RHEL6, python 2.6, in case that's
> relevant) which works with python-bugzilla 1.0 but fails with 1.1.
> Unfortunately it doesn't fail at all for me on my F20 dev machine.
>
> Here's the backtrace:
>
> Traceback (most recent call last):
>    File "/usr/local/bin/review-stats.py", line 612, in <module>
>      bz = bugzilla.RHBugzilla(url=config['url'], cookiefile=None, user=config['username'], password=config['password'])
>    File "/usr/lib/python2.6/site-packages/bugzilla/rhbugzilla.py", line 59, in __init__
>      _add_both_alias('fixed_in', 'cf_fixed_in')
>    File "/usr/lib/python2.6/site-packages/bugzilla/rhbugzilla.py", line 56, in _add_both_alias
>      self._add_field_alias(newname, origname, is_api=False)
> AttributeError: 'RHBugzilla' object has no attribute '_add_field_alias'
>
> This looks like it's down in the bowels of python-bugzilla itself and
> not some trivial issue with my code, so I'm at a loss.  Just in case, if
> I ask for a Bugzilla object instead of a RHBugzilla one, I get a
> different backtrace:
>
> Traceback (most recent call last):
>    File "./review-stats.py", line 614, in <module>
>      (bugs, bugdata, usermap) = run_query(bz)
>    File "./review-stats.py", line 199, in run_query
>      bugs = filter(lambda b: b.id not in trackers, bz.query(querydata))
>    File "/usr/lib/python2.6/site-packages/bugzilla/base.py", line 995, in query
>      return [_Bug(bugzilla=self, dict=b) for b in r['bugs']]
>    File "/usr/lib/python2.6/site-packages/bugzilla/bug.py", line 42, in __init__
>      self._update_dict(dict)
>    File "/usr/lib/python2.6/site-packages/bugzilla/bug.py", line 129, in _update_dict
>      aliases = self.bugzilla._get_bug_aliases()
> AttributeError: 'Bugzilla' object has no attribute '_get_bug_aliases'
>
> You can see the code at
> https://git.fedorahosted.org/cgit/fedora-infrastructure.git/tree/scripts/review-stats
> if that would be useful.
>
> Any ideas would be greatly appreciated, because I'm fresh out.
>

Is this python-bugzilla installed from EPEL?

In a brief test just trying to instantiate RHBugzilla on RHEL6, I didn't see 
any backtrace like the first example.

Any chance you manually installed a previous version of bugzilla and maybe the 
imports are getting messed up? Check /usr/local/... for example. Try fully 
removing all traces of python-bugzilla and reinstalling.

Additionally try latest git, maybe it helps:

git clone git://git.fedorahosted.org/python-bugzilla.git
cd python-bugzilla
[run your script]

- Cole



More information about the python-bugzilla mailing list