[PATCH] Check that opts is not None before accessing.

Kevin Fenzi kevin at scrye.com
Sat May 9 15:54:17 UTC 2015


On Sat, 9 May 2015 08:25:41 -0400
Ralph Bean <rbean at redhat.com> wrote:

> On Fri, May 08, 2015 at 11:56:40AM -0400, Ralph Bean wrote:
> > This should fix the periodic 500 error we get from koji-web in
> > Fedora Infra's staging environment.
> > 
> > Signed-off-by: Ralph Bean <rbean at redhat.com>
> > ---
> >  www/lib/kojiweb/util.py | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/www/lib/kojiweb/util.py b/www/lib/kojiweb/util.py
> > index 89a5ddb..6610beb 100644
> > --- a/www/lib/kojiweb/util.py
> > +++ b/www/lib/kojiweb/util.py
> > @@ -466,7 +466,7 @@ def taskScratchClass(task_object):
> >      request = task_object['request']
> >      if len(request) >= 3:
> >          opts = request[2]
> > -        if opts.get('scratch'):
> > +        if opts and opts.get('scratch'):
> >              return "scratch"
> >      return ""
> >  
> > -- 
> > 2.1.0
> > 
> 
> FYI, we miscommunicated about this in #fedora-releng yesterday and the
> unpatched version got pushed out to prod.  This means that every now
> and then, the koji frontpage fails with 500 (until the task with
> `opts == None` scrolls off the "Recent Tasks" pane).

+1 for hotfixing it now and seeing if we can roll it into a new release
monday before freeze. ;) 

kevin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.fedoraproject.org/pipermail/buildsys/attachments/20150509/77230fa0/attachment.sig>


More information about the buildsys mailing list