summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--exception.py3
-rw-r--r--filer.py23
-rw-r--r--installclasses/fedora.py3
3 files changed, 24 insertions, 5 deletions
diff --git a/exception.py b/exception.py
index b3bd6e039..c54c9a16f 100644
--- a/exception.py
+++ b/exception.py
@@ -412,7 +412,8 @@ def saveToBugzilla(anaconda, exn, dest):
if len(buglist) == 0:
bug = withBugzillaDo(filer, lambda b: b.createbug(product=product.productName,
component="anaconda",
- version=product.productVersion,
+ version=filer.getversion(product.productVersion,
+ product.productName),
platform=rpmUtils.arch.getBaseArch(),
bug_severity="medium",
priority="medium",
diff --git a/filer.py b/filer.py
index 685fbde6d..cb2a87510 100644
--- a/filer.py
+++ b/filer.py
@@ -51,8 +51,9 @@ class CommunicationError(Exception):
# supported. They also define the interface that concrete classes should use,
# as this is what will be expected by exception.py.
class AbstractFiler(object):
- def __init__(self, bugUrl=None):
+ def __init__(self, bugUrl=None, develVersion=None):
self.bugUrl = bugUrl
+ self.develVersion = develVersion
def login(self, username, password):
raise NotImplementedError
@@ -66,6 +67,9 @@ class AbstractFiler(object):
def getbugs(self, idlist):
raise NotImplementedError
+ def getversion(self, ver, prod):
+ raise NotImplementedError
+
def query(self, query):
raise NotImplementedError
@@ -133,8 +137,8 @@ class BugzillaFiler(AbstractFiler):
except socket.error, e:
raise CommunicationError(str(e))
- def __init__(self, bugUrl=None):
- AbstractFiler.__init__(self, bugUrl=bugUrl)
+ def __init__(self, bugUrl=None, develVersion=None):
+ AbstractFiler.__init__(self, bugUrl=bugUrl, develVersion=develVersion)
self._bz = None
def login(self, username, password):
@@ -170,6 +174,19 @@ class BugzillaFiler(AbstractFiler):
lst = self.__withBugzillaDo(lambda b: b.getbugs(idlist))
return map(lambda b: BugzillaBug(self, bug=b), lst)
+ def getversion(self, ver, prod):
+ details = self.__withBugzillaDo(lambda b: b._proxy.bugzilla.getProductDetails(prod))
+ bugzillaVers = details[1]
+ bugzillaVers.sort()
+
+ if ver not in bugzillaVers:
+ if self.develVersion:
+ return self.develVersion
+ else:
+ return bugzillaVers[-1]
+ else:
+ return ver
+
def query(self, query):
lst = self.__withBugzillaDo(lambda b: b.query(query))
return map(lambda b: BugzillaBug(self, bug=b), lst)
diff --git a/installclasses/fedora.py b/installclasses/fedora.py
index e397ef99f..bf264591f 100644
--- a/installclasses/fedora.py
+++ b/installclasses/fedora.py
@@ -49,7 +49,8 @@ class InstallClass(BaseInstallClass):
(N_("Software Development"), ["development-libs", "development-tools", "gnome-software-development", "x-software-development"],),
(N_("Web Server"), ["web-server"])]
- bugFiler = BugzillaFiler(bugUrl="https://bugzilla.redhat.com/xmlrpc.cgi")
+ bugFiler = BugzillaFiler(bugUrl="https://bugzilla.redhat.com/xmlrpc.cgi",
+ develVersion="rawhide")
def getPackagePaths(self, uri):
if not type(uri) == types.ListType: