Commit 29676fb6 authored by Daniel P. Berrangé's avatar Daniel P. Berrangé

lib: don't re-assign $_

Perl has started to forbid code from declaring "my $_", because $_ is
implicitly always a local scope. Rewrite the code to avoid tickling this
warning.
Reviewed-by: 's avatarLaine Stump <laine@laine.org>
Signed-off-by: 's avatarDaniel P. Berrangé <berrange@redhat.com>
parent 424cd734
......@@ -71,11 +71,10 @@ sub expect_result {
sub libvirtd_status {
my $self = shift;
my $status = `service libvirtd status`;
my $_ = $status;
if (/stopped|unused|inactive/) {
if ($status =~ /stopped|unused|inactive/) {
$self->{libvirtd_status} = 'stopped';
} elsif (/running|active/) {
} elsif ($status =~ /running|active/) {
$self->{libvirtd_status} = 'running';
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment