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