enh(mode): Rubrik RestAPI manage disco empty entries (#4720)

This commit is contained in:
Thibault S 2024-02-02 09:50:33 +01:00 committed by GitHub
parent 9d7be65c92
commit 6f5505e103
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 7 deletions

View File

@ -49,7 +49,9 @@ sub manage_selection {
); );
my $results = {}; my $results = {};
foreach (@$jobs) { foreach (@$jobs) {
$results->{ $_->{objectId} } = $_; if (defined($_->{objectId})) {
$results->{ $_->{objectId} } = $_;
}
} }
return $results; return $results;
} }
@ -63,9 +65,9 @@ sub run {
long_msg => sprintf( long_msg => sprintf(
'[jobId: %s][jobName: %s][jobType: %s][locationName: %s]', '[jobId: %s][jobName: %s][jobType: %s][locationName: %s]',
$_->{objectId}, $_->{objectId},
$_->{objectName}, defined($_->{objectName}) ? $_->{objectName} : 'none',
$_->{jobType}, defined($_->{jobType}) ? $_->{jobType} : 'none',
$_->{locationName} defined($_->{locationName}) ? $_->{locationName} : 'none'
) )
); );
} }
@ -91,9 +93,9 @@ sub disco_show {
foreach (values %$results) { foreach (values %$results) {
$self->{output}->add_disco_entry( $self->{output}->add_disco_entry(
jobId => $_->{objectId}, jobId => $_->{objectId},
jobName => $_->{objectName}, jobName => defined($_->{objectName}) ? $_->{objectName} : 'none',
jobType => $_->{jobType}, jobType => defined($_->{jobType}) ? $_->{jobType} : 'none',
locationName => $_->{locationName} locationName => defined($_->{locationName}) ? $_->{locationName} : 'none'
); );
} }
} }