[Maas-devel] Accidental imports of registries into maasserver

Andres Rodriguez andres.rodriguez at canonical.com
Wed Apr 30 13:49:57 UTC 2014


On Tue, Apr 29, 2014 at 11:07 PM, Julian Edwards <
julian.edwards at canonical.com> wrote:

> On 29/04/14 21:27, Gavin Panella wrote:
> > On 29 April 2014 02:06, Julian Edwards <julian.edwards at canonical.com>
> wrote:
> >> Hi,
> >>
> >> I was just reviewing a branch that was trying to import a
> >> provisioningserver registry directly into maasserver.  This is Obviously
> >> Bad™ because it should be using RPC to retrieve the items.
> >>
> >> My question is, can anyone think of an elegant way to prevent this
> >> import from happening in the future?
> >
> > One way would be to create a custom finder/loader for sys.path_hooks
> > [1] that checks the stack for maasserver and rejects the import if
> > found.
> >
> > Another would be to land my repackage branch [2] and prevent the
> > maas-region package from using maas-cluster. This is a big change
> > though, and would have lots of other side-effects.
> >
> >
> > [1] https://docs.python.org/2.7/library/sys.html#sys.path_hooks
> > [2] lp:~allenap/maas/repackage
> >
>
> I am not against big changes if they are beneficial.  Remind me of the
> risks/side-effects again?  I expect at least the Ubuntu packaging would
> be screwed over.
>

Yes, packaging would need to adapt to new upstream and as we discussed, the
different setup files is a PITA.

>
> I think the ideal solution is indeed to prevent the region from seeing
> the cluster code at all.
>
> We could do [1] as an interim though, but limit it to registry as much
> as possible as I think maasserver imports quite a lot stuff from
> provisioningserver :(
>
> --
> Mailing list: https://launchpad.net/~maas-devel
> Post to     : maas-devel at lists.launchpad.net
> Unsubscribe : https://launchpad.net/~maas-devel
> More help   : https://help.launchpad.net/ListHelp
>



-- 
Andres Rodriguez
Engineering Manager, HWE Team
Canonical USA, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/maas-devel/attachments/20140430/c48b8010/attachment.html>


More information about the Maas-devel mailing list