[python-bugzilla] [PATCH] Detection of the RH Bugzilla by the extension() call
Cole Robinson
crobinso at redhat.com
Wed Jan 2 12:55:45 UTC 2013
On 12/13/2012 09:33 AM, Lukas Zachar wrote:
> Part of the planed upgrade to the v4.4 of RH Bugzilla is the removal of
> mirrored XMLRPC calls (rhbz#822007). Among others the
> bugzilla.getProdInfo() which is currently used as indicator of RH
> Bugzilla.
>
> I believe the Bugzilla.extensions() call can be used as a indicator
> instead, although it is marked as unstable.
> ---
> bugzilla/__init__.py | 9 +++++----
> 1 files changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/bugzilla/__init__.py b/bugzilla/__init__.py
> index 1c9f3f5..2f354d9 100644
> --- a/bugzilla/__init__.py
> +++ b/bugzilla/__init__.py
> @@ -29,11 +29,12 @@ def getBugzillaClassForURL(url):
> bzversion = ''
> c = None
>
> - # Check for a RH-only method
> + # Check for a Red Hat extension
> try:
> - log.debug("Checking for RH Bugzilla method bugzilla.getProdInfo()")
> - prodinfo = s.bugzilla.getProdInfo()
> - rhbz = True
> + log.debug("Checking for Red Hat Bugzilla extension")
> + extensions = s.Bugzilla.extensions()
> + if extensions.get('extensions', {}).get('RedHat', False):
> + rhbz = True
> except xmlrpclib.Fault:
> pass
> log.debug("rhbz=%s" % str(rhbz))
Thanks Lukas, pushed now:
http://git.fedorahosted.org/cgit/python-bugzilla.git/commit/?id=1cb7f078694b624cb409b5d1d6d4588768d5dc32
- Cole
More information about the python-bugzilla
mailing list