14
0

Accepting request 177008 from home:matejcik:branches:devel:languages:python

- update to 0.8.0
  * support for Bugzilla 4 and above
  * streamlined internals
- update to suse2 from gitorious
  * include all suse patches
  * use osc's methods to parse .oscrc

OBS-URL: https://build.opensuse.org/request/show/177008
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-bugzilla?expand=0&rev=29
This commit is contained in:
Jan Matejek
2013-05-30 17:17:42 +00:00
committed by Git OBS Bridge
parent 916fcc938d
commit 6911ff1aa1
7 changed files with 16 additions and 105 deletions

View File

@@ -1,62 +0,0 @@
diff --git a/bugzilla/base.py b/bugzilla/base.py
index cfaea45..96a05d7 100644
--- a/bugzilla/base.py
+++ b/bugzilla/base.py
@@ -1050,7 +1050,22 @@ class CookieTransport(xmlrpclib.Transport):
else:
request = request_with_cookies # python 2.6 and earlier
-class SafeCookieTransport(xmlrpclib.SafeTransport,CookieTransport):
+class BasicAuthTransport(xmlrpclib.SafeTransport):
+ """A subclass of xmlrpclib.SafeTransport that allows setting HTTP Basic Auth
+ without exposing it as part of URL in backtraces."""
+ auth_params = None
+
+ def get_host_info(self, host):
+ host, extra_headers, x509 = xmlrpclib.Transport.get_host_info(self, host)
+ if isinstance(self.auth_params, tuple):
+ import base64
+ auth = base64.encodestring("%s:%s" % self.auth_params).strip()
+ if extra_headers is None:
+ extra_headers = []
+ extra_headers.append(("Authorization", "Basic " + auth))
+ return host, extra_headers, x509
+
+class SafeCookieTransport(BasicAuthTransport,CookieTransport):
'''SafeTransport subclass that supports cookies.'''
scheme = 'https'
# Override the appropriate request method
diff --git a/bugzilla/nvlbugzilla.py b/bugzilla/nvlbugzilla.py
index 7e2ec32..5804de4 100644
--- a/bugzilla/nvlbugzilla.py
+++ b/bugzilla/nvlbugzilla.py
@@ -39,8 +39,8 @@ class NovellBugzilla(Bugzilla34):
super(NovellBugzilla, self).__init__(**kwargs)
def _login(self, user, password):
- # using basic auth, so login happens implicitly at connect
- pass
+ # set up data for basic auth transport
+ self._transport.auth_params = (self.user, self.password)
def _logout(self):
# using basic auth, no logout
@@ -57,17 +57,9 @@ class NovellBugzilla(Bugzilla34):
if not hostname.startswith('api'):
hostname = 'api'+hostname
- self.readconfig()
- # set up basic auth url
- if self.user and self.password:
- hostname = self.user + ':' + self.password + '@' + hostname
-
# force https scheme (because of the basic auth)
url = urlparse.urlunsplit(('https', hostname, path, spliturl.query, spliturl.fragment))
- ret = super(NovellBugzilla, self).connect(url)
- # prevent our username+pass url from showing up in __repr__
- self.url = origurl
- return ret
+ return super(NovellBugzilla, self).connect(url)
@classmethod
def _read_osc_password(cls, c):

View File

@@ -1,13 +0,0 @@
Index: python-bugzilla-0.6.2/bin/bugzilla
===================================================================
--- python-bugzilla-0.6.2.orig/bin/bugzilla
+++ python-bugzilla-0.6.2/bin/bugzilla
@@ -22,7 +22,7 @@ import xmlrpclib
from tempfile import NamedTemporaryFile
version = '0.6.2'
-default_bz = 'https://bugzilla.redhat.com/xmlrpc.cgi'
+default_bz = 'https://bugzilla.novell.com/xmlrpc.cgi'
# Initial simple logging stuff
logging.basicConfig()

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2597f851fc5189bfa24fb19d5c32a65fc297735f3fa1074e6fc074729d07a5f2
size 41538

View File

@@ -1,16 +0,0 @@
--- a/bugzilla/nvlbugzilla.py
+++ b/bugzilla/nvlbugzilla.py
@@ -82,7 +82,12 @@ class NovellBugzilla(Bugzilla34):
obs_url = self.__class__.obs_url
if not c.has_section(obs_url):
- return
+ if obs_url[-1:] == '/':
+ # strip the final slash and retry
+ self.__class__.obs_url = obs_url[:-1]
+ obs_url = self.__class__.obs_url
+ if not c.has_section(obs_url):
+ return
try:
user = c.get(obs_url, 'user')

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0bc2da5ce1e5852746cf3f657f1a27589de29959da308db63af74957ce380d8c
size 47898

View File

@@ -1,3 +1,13 @@
-------------------------------------------------------------------
Fri May 24 18:36:22 UTC 2013 - jmatejek@suse.com
- update to 0.8.0
* support for Bugzilla 4 and above
* streamlined internals
- update to suse2 from gitorious
* include all suse patches
* use osc's methods to parse .oscrc
-------------------------------------------------------------------
Wed May 22 12:13:06 UTC 2013 - speilicke@suse.com

View File

@@ -17,18 +17,14 @@
Name: python-bugzilla
Version: 0.6.2
Version: 0.8.0suse2
Release: 0
Summary: Python library for bugzilla
License: GPL-2.0+
Group: Development/Libraries/Python
Url: https://fedorahosted.org/python-bugzilla/
#Source: https://fedorahosted.org/releases/p/y/python-bugzilla/%{name}-%{version}.tar.bz2
Source: %{name}-%{version}-openSUSE-1.tar.bz2
Source: %{name}-%{version}.tar.bz2
# https://gitorious.org/opensuse/python-bugzilla
Patch0: %{name}-0.6.2-novell-default.patch
Patch1: %{name}-0.6.2-backtraces.patch
Patch2: %{name}-0.6.2-section.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: python-devel
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
@@ -36,6 +32,7 @@ BuildRequires: python-devel
%else
BuildArch: noarch
%endif
Suggests: osc
%description
This is a python module that provides a nice, python-ish interface to Bugzilla
@@ -50,17 +47,12 @@ but gosh - why not just write something in Python instead?
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%build
CFLAGS="%{optflags}" python setup.py build
%install
python setup.py install --root=%{buildroot} --prefix=%{_prefix}
#\ --record-rpm=INSTALLED_FILES
#sed -i 's#%{_mandir}/man1/bugzilla.1#%{_mandir}/man1/bugzilla.1.gz#' INSTALLED_FILES
%files
%defattr(-,root,root,-)