[python-bugzilla] [PATCH] Special-case bugzilla.mozilla.org
Cole Robinson
crobinso at redhat.com
Wed Apr 8 19:10:10 UTC 2015
Agreed, but we will deal with that if/when it comes to it.
Thanks,
Cole
On 04/08/2015 02:55 PM, Dustin Mitchell wrote:
> Rock on, thanks!
>
> By the way, I checked with the BMO folks, and they made this change
> because the site is a mix of 4.2, 4.4, 4.5, and a whole bunch of local
> hacks. So it may soon come to pass that you need a custom subclass
> for the site. For what I need (well, what bugwarrior needs),
> Bugzilla42 is sufficient at the moment.
>
> Dustin
>
> On Wed, Apr 8, 2015 at 2:52 PM, Cole Robinson <crobinso at redhat.com> wrote:
>> On 04/07/2015 01:42 PM, Dustin J. Mitchell wrote:
>>> ---
>>> bugzilla/__init__.py | 5 ++++-
>>> 1 file changed, 4 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/bugzilla/__init__.py b/bugzilla/__init__.py
>>> index 138bd3b..52f77bc 100644
>>> --- a/bugzilla/__init__.py
>>> +++ b/bugzilla/__init__.py
>>> @@ -41,18 +41,21 @@ def _getBugzillaClassForURL(url, sslverify):
>>> rhbz = False
>>> bzversion = ''
>>> c = None
>>>
>>> if "bugzilla.redhat.com" in url:
>>> log.info("Using RHBugzilla for URL containing bugzilla.redhat.com")
>>> return RHBugzilla
>>> if "bugzilla.novell.com" in url:
>>> - log.info("Using NovellBugzilla for URL containing novell.com")
>>> + log.info("Using NovellBugzilla for URL containing bugzilla.novell.com")
>>> return NovellBugzilla
>>> + if "bugzilla.mozilla.org" in url:
>>> + log.info("Using Bugzilla42 for URL containing bugzilla.mozilla.org")
>>> + return Bugzilla42
>>>
>>> # Check for a Red Hat extension
>>> try:
>>> log.debug("Checking for Red Hat Bugzilla extension")
>>> extensions = s.Bugzilla.extensions()
>>> if extensions.get('extensions', {}).get('RedHat', False):
>>> rhbz = True
>>> except Fault:
>>>
>>
>> Works for me, I've pushed this now, and added a testcase for it too.
>>
>> - Cole
More information about the python-bugzilla
mailing list