[pve-devel] [PATCH] check for valid config changes

Daniel Hunsaker danhunsaker at gmail.com
Tue Feb 25 19:29:25 CET 2014


It can happen (mostly with custom software written against the API rather
than the web interface that ships with), but doesn't make much sense.  You
either want to set a value, or you want to remove it.  Doing both seems
pretty pointless.

My input would be to either do what we're doing now, and have delete
effectively override set, or what Dietmar proposed, which is to throw an
error if a request comes in asking to do both.  I'd actually lean toward
the latter, too, for principle of least surprise.
On Feb 25, 2014 11:23 AM, "Stefan Priebe" <s.priebe at profihost.ag> wrote:

>
> Am 25.02.2014 16:48, schrieb Dietmar Maurer:
>
>> -           foreach my $opt (keys %$param) { # add/change
>>> +           my $conf_param = { %$param, map {$_ => undef} @delete };
>>>
>>
>> I guess you need to process @delete parameters first? Or maybe we should
>> check
>> that we do net set both (param value and delete)?
>>
>
> my idea was that delete is more important than param so @delete params
> overwrite param.
>
> Can it happen that we have both?
>
> Stefan
>
>
> _______________________________________________
> pve-devel mailing list
> pve-devel at pve.proxmox.com
> http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.proxmox.com/pipermail/pve-devel/attachments/20140225/830a95e5/attachment.htm>


More information about the pve-devel mailing list