diff options
author | Chris Lumens <clumens@redhat.com> | 2008-10-28 14:19:14 -0400 |
---|---|---|
committer | Chris Lumens <clumens@redhat.com> | 2008-10-28 14:19:38 -0400 |
commit | 6ff45a75a7c64b940e35e55324e8eb30537b595e (patch) | |
tree | 10f0c637539017ea32e9e8400c947154776c2793 /filer.py | |
parent | 3dfbd17328bf9fc02e03616fd355f6f9e4277e0e (diff) | |
download | anaconda-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.py | 23 |
1 files changed, 20 insertions, 3 deletions
@@ -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) |