[Maas-devel] Accidental imports of registries into maasserver
Julian Edwards
julian.edwards at canonical.com
Wed Apr 30 03:07:32 UTC 2014
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.
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 :(
More information about the Maas-devel
mailing list