maas-devel team mailing list archive
-
maas-devel team
-
Mailing list archive
-
Message #01586
Re: Accidental imports of registries into maasserver
On 29 April 2014 02:06, Julian Edwards <julian.edwards@xxxxxxxxxxxxx> 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
Follow ups
References