maas-devel team mailing list archive
-
maas-devel team
-
Mailing list archive
-
Message #02184
Re: Unique Space Names
On Thu, Nov 5, 2015 at 5:29 AM, John Meinel <john@xxxxxxxxxxxxxxxxx> wrote:
> That is, we probably made it unique=False to work around this quirk in
>> Django, when we should have done it a slightly different way, such as the
>> one captured in the answer. (what we really wanted to say was, names must
>> be unique, unless they're NULL, in which case they will be represented by
>> ID instead.)
>>
>
> Sounds good. Given what a space means, I'd be tempted to not have ones
> that don't have a name, but instead have a NULL reference to a space for
> Fabrics and Subnets that have been autodiscovered. (As you say, a space is
> a user construct to aggregate subnets into logical groupings, and thus
> unlikely something that could be discovered.)
>
The current approach is almost much what you describe; we create a
"default" space (whose ID is always 0) and, newly-discovered objects are
always placed into the default space. (doing it the way you describe would
have worked, too, but then we'd need to worry about NULL or not-NULL edge
cases.)
Regards,
Mike
References