← Back to team overview

launchpad-reviewers team mailing list archive

Re: [Merge] ~cjwatson/launchpad:stormify-builder into launchpad:master

 


Diff comments:

> diff --git a/lib/lp/buildmaster/model/builder.py b/lib/lp/buildmaster/model/builder.py
> index 93326ee..5e66baf 100644
> --- a/lib/lp/buildmaster/model/builder.py
> +++ b/lib/lp/buildmaster/model/builder.py
> @@ -218,14 +238,11 @@ class BuilderSet(object):
>          self.title = "The Launchpad build farm"
>  
>      def __iter__(self):
> -        return iter(Builder.select())
> +        return iter(IStore(Builder).find(Builder))
>  
>      def getByName(self, name):
>          """See IBuilderSet."""
> -        try:
> -            return Builder.selectOneBy(name=name)
> -        except SQLObjectNotFound:
> -            raise NotFoundError(name)
> +        return IStore(Builder).find(Builder, name=name).one()

This looks like an odd transformation, but it's because SQLObjectBase.selectOneBy in fact can't raise SQLObjectNotFound, so the original version contained unreachable code.

>  
>      def __getitem__(self, name):
>          return self.getByName(name)


-- 
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/395397
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:stormify-builder into launchpad:master.


References