summaryrefslogtreecommitdiffstats
path: root/filer.py
diff options
context:
space:
mode:
authorChris Lumens <clumens@redhat.com>2008-10-28 14:19:14 -0400
committerChris Lumens <clumens@redhat.com>2008-10-28 14:19:38 -0400
commit6ff45a75a7c64b940e35e55324e8eb30537b595e (patch)
tree10f0c637539017ea32e9e8400c947154776c2793 /filer.py
parent3dfbd17328bf9fc02e03616fd355f6f9e4277e0e (diff)
downloadanaconda-6ff45a75a7c64b940e35e55324e8eb30537b595e.tar.gz
anaconda-6ff45a75a7c64b940e35e55324e8eb30537b595e.tar.xz
anaconda-6ff45a75a7c64b940e35e55324e8eb30537b595e.zip
Make sure the productVersion given by .treeinfo exists in bugzilla (#468657).
Prerelease version of Fedora sometimes get version numbers in .treeinfo or .buildstamp like 10-Beta. However, this version does not exist in bugzilla so we get an error trying to save the bug. This could also happen in respins. So, grab a list of all the versions that are valid for the product out of bugzilla and make sure productVersion exists. If not, either use the develVersion from the installclass or just use the last one out of the the list.
Diffstat (limited to 'filer.py')
-rw-r--r--filer.py23
1 files changed, 20 insertions, 3 deletions
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)