Used to be that "ppc" was not a valid platform in bugzilla but "powerpc"
was. Of course, rpmUtils.arch.getBaseArch returned the former. Well
that's been corrected in our bugzilla now, but this patch is still valid
as far as I'm concerned.
This checks the platform and sets it to All if rpmUtils returns
something that bugzilal doesn't understand, and checks that
product.productName also exists in bugzilla. It's up to the install
class to give us a useful backup there, just like it is with the
version.
- Chris
diff --git a/exception.py b/exception.py
index 70b61c0..e4e7c08 100644
--- a/exception.py
+++ b/exception.py
@@ -408,9 +408,8 @@ def saveToBugzilla(anaconda, exn, dest):
if buglist is None:
return False
- # FIXME: need to handle all kinds of errors here
if len(buglist) == 0:
- bug = withBugzillaDo(filer, lambda b: b.createbug(product=product.productName,
+ bug = withBugzillaDo(filer, lambda b: b.createbug(product=filer.getproduct(product.produ ctName),
component="anaconda",
version=filer.getversion(product.productVersion,
product.productName),
diff --git a/filer.py b/filer.py
index e8431ea..74e8461 100644
--- a/filer.py
+++ b/filer.py
@@ -66,7 +66,7 @@ class AbstractFiler(object):
ValueError -- For all other operations where the client
supplied values are not correct.
"""
- def __init__(self, bugUrl=None, develVersion=None):
+ def __init__(self, bugUrl=None, develVersion=None, defaultProduct=None):
"""Create a new AbstractFiler instance. This method need not be
overridden by subclasses.
@@ -75,6 +75,9 @@ class AbstractFiler(object):
the development version. This is used in case
anaconda attempts to file bugs against invalid
versions. It need not be set.
+ defaultProduct -- The product bugs should be filed against, should
+ anaconda get an invalid product name from the
+ boot media. This must be set.
"""
self.bugUrl = bugUrl
self.develVersion = develVersion
@@ -109,6 +112,14 @@ class AbstractFiler(object):
"""
raise NotImplementedError
+ def getproduct(self, prod):
+ """Verify that prod is a valid product name. If it is, return that
+ same product name. If not, return self.defaultProduct. This method
+ queries the bug filing system for a list of valid products. It must
+ be provided by all subclasses.
+ """
+ raise NotImplementedError
+
def getversion(self, ver, prod):
"""Verify that ver is a valid version number for the product name prod.
If it is, return that same version number. If not, return
@@ -286,8 +297,9 @@ class BugzillaFiler(AbstractFiler):
except socket.error, e:
raise CommunicationError(str(e))
def getPackagePaths(self, uri):
if not type(uri) == types.ListType:
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
10-31-2008, 07:16 PM
Jeremy Katz
- more save to bugzilla error checking
On Fri, 2008-10-31 at 15:47 -0400, Chris Lumens wrote:
> Used to be that "ppc" was not a valid platform in bugzilla but "powerpc"
> was. Of course, rpmUtils.arch.getBaseArch returned the former. Well
> that's been corrected in our bugzilla now, but this patch is still valid
> as far as I'm concerned.
>
> This checks the platform and sets it to All if rpmUtils returns
> something that bugzilal doesn't understand, and checks that
> product.productName also exists in bugzilla. It's up to the install
> class to give us a useful backup there, just like it is with the
> version.
Looks okay -- one minor nit
> diff --git a/filer.py b/filer.py
> index e8431ea..74e8461 100644
> --- a/filer.py
> +++ b/filer.py
> @@ -310,6 +322,11 @@ class BugzillaFiler(AbstractFiler):
> whiteboards.append((wb, val))
> kwargs.pop(key)
>
> + if key == "platform":
> + platformLst = self.__withBugzillaDo(lambda b: b._proxy.Bug.legal_values({'field': 'platform'}))
> + if not val in platformLst:
> + kwargs[key] = "All"
Is All guaranteed to be in the list? Obviously it is in our bugzilla,
but maybe we should fall back to gettin ga list of platforms (is that
even possible) and just chucking in the first one? We should at least
verify that All is valid and give a nice error like we do for other
cases
Jeremy
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
10-31-2008, 07:21 PM
Chris Lumens
- more save to bugzilla error checking
> Is All guaranteed to be in the list? Obviously it is in our bugzilla,
> but maybe we should fall back to gettin ga list of platforms (is that
> even possible) and just chucking in the first one? We should at least
> verify that All is valid and give a nice error like we do for other
> cases
I don't know whether All is guaranteed to be there or not. The
legal_values call actually does return a list, and All is the first
element of it in RH bugzilla. So it'd be easy to just use the first
element. I'll go ahead and make that change.
- Chris
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list