17
0

- add 0005-Add-Bugzilla34._query.patch fixing query command

- add 0020-allow-various-bnc-instances-in-NovellBugzilla.patch

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-bugzilla?expand=0&rev=15
This commit is contained in:
2011-07-29 08:51:45 +00:00
committed by Git OBS Bridge
parent 27bc89d46b
commit fdbef5c4e1
4 changed files with 117 additions and 5 deletions

View File

@@ -0,0 +1,50 @@
From 81c40230599e54eb51a2dc5fc538dd85b02a9998 Mon Sep 17 00:00:00 2001
From: Will Woods <wwoods@redhat.com>
Date: Mon, 28 Jun 2010 11:24:25 -0400
Subject: [PATCH 05/20] Add Bugzilla34._query
---
bugzilla/bugzilla3.py | 20 +++++++++++++++++++-
1 files changed, 19 insertions(+), 1 deletions(-)
diff --git a/bugzilla/bugzilla3.py b/bugzilla/bugzilla3.py
index 52890b4..e7ff393 100644
--- a/bugzilla/bugzilla3.py
+++ b/bugzilla/bugzilla3.py
@@ -125,7 +125,7 @@ class Bugzilla32(Bugzilla3):
# Bugzilla 3.4 adds some new goodies on top of Bugzilla32.
class Bugzilla34(Bugzilla32):
- version = '0.1'
+ version = '0.2'
user_agent = bugzilla.base.user_agent + ' Bugzilla34/%s' % version
def _getusers(self, ids=None, names=None, match=None):
@@ -157,6 +157,24 @@ class Bugzilla34(Bugzilla32):
return self._proxy.User.get(params)
+ def _query(self,query):
+ '''Query bugzilla and return a list of matching bugs.
+ query must be a dict with fields like those in in querydata['fields'].
+ You can also pass in keys called 'quicksearch' or 'savedsearch' -
+ 'quicksearch' will do a quick keyword search like the simple search
+ on the Bugzilla home page.
+ 'savedsearch' should be the name of a previously-saved search to
+ execute. You need to be logged in for this to work.
+ Returns a dict like this: {'bugs':buglist,
+ 'sql':querystring}
+ buglist is a list of dicts describing bugs, and 'sql' contains the SQL
+ generated by executing the search.
+ You can also pass 'limit:[int]' to limit the number of results.
+ For more info, see:
+ http://www.bugzilla.org/docs/3.4/en/html/api/Bugzilla/WebService/Bug.html
+ '''
+ return self._proxy.Bug.search(query)
+
# Bugzilla 3.6 was released April 13, 2010
# XXX TODO probably more new methods from Bugzilla 3.6 we could use
class Bugzilla36(Bugzilla34):
--
1.7.6

View File

@@ -0,0 +1,52 @@
From ecfc614863186f8b70846e388e038d3c2385f630 Mon Sep 17 00:00:00 2001
From: Michal Vyskocil <mvyskocil@suse.cz>
Date: Thu, 26 May 2011 11:00:33 +0200
Subject: [PATCH 20/20] allow various bnc instances in NovellBugzilla
The older NovellBugzilla implementation was limited to
bugzilla.novell.com, so using of internal testing instace was not
possible. So code in NovellBugzilla.__init__ and getBugzillaClassForURL
search for 'novell.com' string only.
In adition NovellBugzilla.__init__ add a url= argument to kwargs if not
exists or if it does not contain novell.com, so this class can be simple
instantiated without arguments in some cases.
---
bugzilla/__init__.py | 2 +-
bugzilla/nvlbugzilla.py | 6 ++++--
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/bugzilla/__init__.py b/bugzilla/__init__.py
index 8b26835..c66b874 100644
--- a/bugzilla/__init__.py
+++ b/bugzilla/__init__.py
@@ -23,7 +23,7 @@ classlist = ['Bugzilla3', 'Bugzilla32', 'Bugzilla34', 'Bugzilla36',
def getBugzillaClassForURL(url):
log.debug("Choosing subclass for %s" % url)
- if url.startswith('https://bugzilla.novell.com'):
+ if 'novell.com' in url:
return NovellBugzilla
s = xmlrpclib.ServerProxy(url)
diff --git a/bugzilla/nvlbugzilla.py b/bugzilla/nvlbugzilla.py
index 4acae00..da2876d 100644
--- a/bugzilla/nvlbugzilla.py
+++ b/bugzilla/nvlbugzilla.py
@@ -55,9 +55,11 @@ class NovellBugzilla(Bugzilla34):
def __init__(self, expires=300, **kwargs):
self._expires = expires
+ # allow proper usage of NovellBugzilla with a wrong url argument
+ # (without it or with an another location)
+ if not 'novell.com' in kwargs.get('url', ''):
+ kwargs['url'] = self.__class__.bugzilla_url
super(NovellBugzilla, self).__init__(**kwargs)
- # url argument exists only for backward compatibility, but is always set to same url
- self.url = self.__class__.bugzilla_url
def __get_expiration(self):
return self._expires
--
1.7.6

View File

@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Jul 29 08:50:47 UTC 2011 - mvyskocil@suse.cz
- add 0005-Add-Bugzilla34._query.patch fixing query command
- add 0020-allow-various-bnc-instances-in-NovellBugzilla.patch
-------------------------------------------------------------------
Mon May 23 12:36:47 UTC 2011 - mvyskocil@suse.cz

View File

@@ -29,11 +29,13 @@ Source: https://fedorahosted.org/releases/p/y/python-bugzilla/%{name}-%{
# generated from python-bugzilla/suse
# https://gitorious.org/opensuse/python-bugzilla/commits/suse
# cherry-picked patches from git format-patch suse...0.6.1
Patch0: 0012-Fix-for-httplib-xmlrpclib-changes-in-py2.7.patch
Patch1: 0016-obfuscated-password-support-in-oscrc.patch
Patch2: 0017-fix-typo-in-url-argument.patch
Patch3: 0018-novell-bugzilla-support-in-getBugzillaClassForURL.patch
Patch4: 0019-novell-bugzilla-run-on-3.4.patch
Patch0: 0005-Add-Bugzilla34._query.patch
Patch1: 0012-Fix-for-httplib-xmlrpclib-changes-in-py2.7.patch
Patch2: 0016-obfuscated-password-support-in-oscrc.patch
Patch3: 0017-fix-typo-in-url-argument.patch
Patch4: 0018-novell-bugzilla-support-in-getBugzillaClassForURL.patch
Patch5: 0019-novell-bugzilla-run-on-3.4.patch
Patch6: 0020-allow-various-bnc-instances-in-NovellBugzilla.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: python-devel
BuildArch: noarch
@@ -57,6 +59,8 @@ but gosh - why not just write something in Python instead?
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%build
export CFLAGS="%{optflags}"