@ -1261,6 +1261,26 @@ sub collect_pvs_data
return_code => $return_code,
}});
# If there's an old filter in lvm.conf, it will generate an error that breaks the JSON formatting.
# See: https://issues.redhat.com/browse/RHEL-29680
if ($output =~ /remove the lvm.conf filter/gs)
{
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 1, key => "scan_lvm_log_0002"});
my $new_output = "";
foreach my $line (split/\n/, $output)
{
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { line => $line }});
if ($line =~ /remove the lvm.conf filter/)
{
next;
}
$new_output .= $line."\n";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { new_output => $new_output }});
}
$output = $new_output;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { output => $output }});
}
my $json = JSON->new->allow_nonref;
my $pvs_data = $json->decode($output);
my $default_sector_size = 512;
@ -1364,6 +1384,26 @@ sub collect_vgs_data
return_code => $return_code,
}});
# If there's an old filter in lvm.conf, it will generate an error that breaks the JSON formatting.
# See: https://issues.redhat.com/browse/RHEL-29680
if ($output =~ /remove the lvm.conf filter/gs)
{
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 1, key => "scan_lvm_log_0002"});
my $new_output = "";
foreach my $line (split/\n/, $output)
{
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { line => $line }});
if ($line =~ /remove the lvm.conf filter/)
{
next;
}
$new_output .= $line."\n";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { new_output => $new_output }});
}
$output = $new_output;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { output => $output }});
}
my $json = JSON->new->allow_nonref;
my $vgs_data = $json->decode($output);
foreach my $hash_ref (@{$vgs_data->{report}->[0]->{vg}})
@ -1408,6 +1448,26 @@ sub collect_lvs_data
return_code => $return_code,
}});
# If there's an old filter in lvm.conf, it will generate an error that breaks the JSON formatting.
# See: https://issues.redhat.com/browse/RHEL-29680
if ($output =~ /remove the lvm.conf filter/gs)
{
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 1, key => "scan_lvm_log_0002"});
my $new_output = "";
foreach my $line (split/\n/, $output)
{
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { line => $line }});
if ($line =~ /remove the lvm.conf filter/)
{
next;
}
$new_output .= $line."\n";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { new_output => $new_output }});
}
$output = $new_output;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { output => $output }});
}
my $json = JSON->new->allow_nonref;
my $lvs_data = $json->decode($output);
foreach my $hash_ref (@{$lvs_data->{report}->[0]->{lv}})