The resource relocation endpoint would produce a warning when there are no blocking resources on the target node: > Can't use an undefined value as an ARRAY reference
Align the relocation endpoint to do the check in the same manner as the migration endpoint to avoid the warning. Signed-off-by: Fiona Ebner <[email protected]> --- Changes in v2: * Alternative approach, align check for relocation with how it's done for migration. This avoids the need to adapt callers outside the ha-manager package, which v1 failed to do. src/PVE/API2/HA/Resources.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PVE/API2/HA/Resources.pm b/src/PVE/API2/HA/Resources.pm index 894fe90..acdd499 100644 --- a/src/PVE/API2/HA/Resources.pm +++ b/src/PVE/API2/HA/Resources.pm @@ -495,7 +495,7 @@ __PACKAGE__->register_method({ my $blocking_resources = $blocking_resources_by_node->{$req_node}; $result->{'comigrated-resources'} = $comigrated_resources if @$comigrated_resources; - $result->{'blocking-resources'} = $blocking_resources if @$blocking_resources; + $result->{'blocking-resources'} = $blocking_resources if $blocking_resources; return $result; }, -- 2.47.3 _______________________________________________ pve-devel mailing list [email protected] https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
