Thanks for reviewing!

On Wed Aug 27, 2025 at 3:41 PM CEST, Michael Köppl wrote:
> On Thu Aug 21, 2025 at 4:35 PM CEST, Daniel Kral wrote:
>> diff --git a/src/PVE/HA/NodeStatus.pm b/src/PVE/HA/NodeStatus.pm
>> index 0d04cd53..e2abfd6e 100644
>> --- a/src/PVE/HA/NodeStatus.pm
>> +++ b/src/PVE/HA/NodeStatus.pm
>> @@ -92,6 +92,20 @@ sub list_online_nodes {
>>      return $res;
>>  }
>>  
>> +sub check_for_changed_nodelist {
>> +    my ($self, $node_info) = @_;
>> +
>> +    for my $node (sort keys %$node_info) {
>> +        return 1 if !$self->{status}->{$node};
>> +    }
>> +
>> +    for my $node (sort keys $self->{status}->%*) {
>> +        return 1 if !$node_info->{$node};
>> +    }
>> +
>> +    return 0;
>> +}
> Is the sort necessary for the loops? It seems to me that the order of keys
> doesn't really matter for this.

That's right, the sort is unnecessary here and should be removed in a
v2.

>
> Also, could it make sense (not necessarily in this series) to move this to
> HashTools? It's not used anywhere else now, but I might come in handy
> for further extensions of the HA rules implementation, whenever you need
> to check if 2 sets match exactly.

Hm, could be useful if there's another use case for that, but I'd let
that check stay here for now as else it would be a helper calling a
single-use helper.


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to