[libvirt] [tck PATCH v2 15/15] lib: fix array value accessor to use preferred style

Laine Stump laine at laine.org
Fri Jun 8 15:44:08 UTC 2018


On 06/08/2018 10:55 AM, Daniel P. Berrangé wrote:
> Signed-off-by: Daniel P. Berrangé <berrange at redhat.com>

What? You've found a style error in my cargo-cult perl? Astounding!! :-P
(My recollection is that I tried several different combinations until I
hit on one that worked. I don't perl so good...)


Reviewed-by: Laine Stump <laine at laine.org>

> ---
>  lib/Sys/Virt/TCK.pm | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/Sys/Virt/TCK.pm b/lib/Sys/Virt/TCK.pm
> index 60bd136..78d3774 100644
> --- a/lib/Sys/Virt/TCK.pm
> +++ b/lib/Sys/Virt/TCK.pm
> @@ -1275,7 +1275,7 @@ sub get_ip_from_leases{
>      my $net = $conn->get_network_by_name($netname);
>      if ($net->can('get_dhcp_leases')) {
>          my @leases = $net->get_dhcp_leases($mac);
> -        return @leases ? @leases[0]->{'ipaddr'} : undef;
> +        return @leases ? $leases[0]->{'ipaddr'} : undef;
>      }
>  
>      my $tmp = `grep $mac /var/lib/libvirt/dnsmasq/default.leases`;





More information about the libvir-list mailing list