From bf2e3e25fb40fdc44c1c86f1f3c6dc8b33ea600b Mon Sep 17 00:00:00 2001 From: digimer Date: Mon, 3 Apr 2023 13:17:01 -0400 Subject: [PATCH] * Added a check for undefined variable/value pairs in cachevault data that was causeing SQL UPDATE errors. Signed-off-by: digimer --- scancore-agents/scan-storcli/scan-storcli | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scancore-agents/scan-storcli/scan-storcli b/scancore-agents/scan-storcli/scan-storcli index a499ff9e..de8eeea4 100755 --- a/scancore-agents/scan-storcli/scan-storcli +++ b/scancore-agents/scan-storcli/scan-storcli @@ -4381,6 +4381,7 @@ INSERT INTO foreach my $variable (sort {$a cmp $b} keys %{$anvil->data->{sql}{scan_storcli_variables}{scan_storcli_variable_uuid}{source_table}{'scan_storcli_cachevaults'}{source_uuid}{$cachevault_uuid}{$type}}) { # This variable has vanished + next if not defined $anvil->data->{sql}{scan_storcli_variables}{scan_storcli_variable_uuid}{source_table}{'scan_storcli_cachevaults'}{source_uuid}{$cachevault_uuid}{$type}{$variable}{scan_storcli_variable_value}; my $old_variable_value = $anvil->data->{sql}{scan_storcli_variables}{scan_storcli_variable_uuid}{source_table}{'scan_storcli_cachevaults'}{source_uuid}{$cachevault_uuid}{$type}{$variable}{scan_storcli_variable_value}; my $variable_uuid = $anvil->data->{sql}{scan_storcli_variables}{scan_storcli_variable_uuid}{source_table}{'scan_storcli_cachevaults'}{source_uuid}{$cachevault_uuid}{$type}{$variable}{scan_storcli_variable_uuid}; $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { @@ -9070,8 +9071,8 @@ sub get_cachevault_data ($variable, $value) = ($line =~ /^(.{$split_point})(.*)$/); $variable =~ s/\s+$//; $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { - variable => $variable, - value => $value, + 's1:variable' => $variable, + 's2:value' => $value, }}); }