From a41be63921fb498aafcbaae6fc7df64c6d134512 Mon Sep 17 00:00:00 2001 From: Robert Buchholz Date: Wed, 22 Apr 2009 11:39:38 +0000 Subject: Adapt bugzilla config for pybugz 0.7.4_rc3. svn path=/; revision=1295 --- lib/python/cvetools.py | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'lib') diff --git a/lib/python/cvetools.py b/lib/python/cvetools.py index 46868c2..e2d29a6 100644 --- a/lib/python/cvetools.py +++ b/lib/python/cvetools.py @@ -192,13 +192,7 @@ class BugReporter: CVEGROUPALL = re.compile(r'[ (]*CVE-(\d{4})([-,(){}|, \d]+)') CVEGROUPSPLIT = re.compile(r'(?<=\D)(\d{4})(?=\D|$)') def __init__(self, username = None, password = None): - try: - import bugz - except: - return - - # edit bugz config defaults for us - bugz.config.params['post'] = { + postconfig = { 'product': 'Gentoo Security', 'version': 'unspecified', 'rep_platform': 'All', @@ -216,7 +210,20 @@ class BugReporter: 'short_desc': '', 'comment': '', } - self.bugz_auth = bugz.Bugz(base = "https://bugs.gentoo.org", + + try: + import bugz.bugzilla + bugz.bugzilla.config.params['post'] = postconfig + Bugz = bugz.bugzilla.Bugz + except: + try: + import bugz + except: + return + bugz.config.params['post'] = postconfig + Bugz = bugz.Bugz + + self.bugz_auth = Bugz(base = "https://bugs.gentoo.org", user = username, password = password, forget = False) -- cgit v1.2.3-65-gdbad