← Back to team overview

launchpad-reviewers team mailing list archive

Re: [Merge] lp:~cjwatson/launchpad/snap-without-distro-series into lp:launchpad

 

Review: Approve code



Diff comments:

> 
> === modified file 'lib/lp/snappy/model/snapbase.py'
> --- lib/lp/snappy/model/snapbase.py	2019-02-07 16:33:39 +0000
> +++ lib/lp/snappy/model/snapbase.py	2019-02-07 16:33:39 +0000
> @@ -127,6 +127,16 @@
>              if snap_base is not None:
>                  removeSecurityProxy(snap_base).is_default = True
>  
> +    def findForSnapcraftData(self, snapcraft_data):
> +        """See `ISnapBaseSet`."""
> +        if "base" in snapcraft_data:
> +            snap_base_name = snapcraft_data["base"]
> +            if isinstance(snap_base_name, bytes):
> +                snap_base_name = snap_base_name.decode("UTF-8")
> +            return self.getByName(snap_base_name)
> +        else:
> +            return self.getDefault()

All other knowledge about snap.yaml is in snap.py, and I'd prefer it didn't leak as it's not a precisely stable interface.

> +
>      def getAll(self):
>          """See `ISnapBaseSet`."""
>          return IStore(SnapBase).find(SnapBase).order_by(SnapBase.name)


-- 
https://code.launchpad.net/~cjwatson/launchpad/snap-without-distro-series/+merge/362730
Your team Launchpad code reviewers is subscribed to branch lp:launchpad.


References