[pve-devel] [PATCH cluster 1/3] remote_node_ip: use same return signature for both branches
Thomas Lamprecht
t.lamprecht at proxmox.com
Tue May 2 11:51:20 CEST 2017
We have two return statements in the remote_node_ip submethod, one
checked if we are in list context and adapt the returning values
accordingly and one just returned a list, independent of the
context.
Adapt the second one and check the context there.
Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
data/PVE/Cluster.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/data/PVE/Cluster.pm b/data/PVE/Cluster.pm
index 04237cb..f764e8a 100644
--- a/data/PVE/Cluster.pm
+++ b/data/PVE/Cluster.pm
@@ -1022,7 +1022,7 @@ sub remote_node_ip {
$family =
PVE::Tools::get_host_address_family($ip);
}
- return ($ip, $family);
+ return wantarray ? ($ip, $family) : $ip;
}
}
--
2.11.0
More information about the pve-devel
mailing list