fix(sun-mgmt+salesforce): two coding issues that caused perl warnings (#5369)

Refs: CTOR-1197
This commit is contained in:
omercier 2024-12-27 16:53:32 +01:00 committed by GitHub
parent f1ab4d9ab1
commit b8927e66db
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 26 additions and 25 deletions

View File

@ -112,7 +112,7 @@ sub request_api {
$self->{output}->option_exit(); $self->{output}->option_exit();
} }
if ($self->{http}->get_code() != 200) { if ($self->{http}->get_code() != 200) {
$self->{output}->add_option_msg(short_msg => "Connection issue: " . $decoded->{message}); $self->{output}->add_option_msg(short_msg => "Connection issue: " . defined($decoded->{message}) ? $decoded->{message} : '');
$self->{output}->option_exit(); $self->{output}->option_exit();
} }
@ -125,11 +125,11 @@ __END__
=head1 NAME =head1 NAME
SFDC API boilerplate Monitor SFDC API boilerplate
=head1 SYNOPSIS =head1 SYNOPSIS
Get informations from SFDC API Get information from SFDC API
=head1 REST API OPTIONS =head1 REST API OPTIONS
@ -137,15 +137,15 @@ Get informations from SFDC API
=item B<--hostname> =item B<--hostname>
Set hostname to query (default: 'api.status.salesforce.com') Define the hostname to query (default: C<api.status.salesforce.com>)
=item B<--timeout> =item B<--timeout>
Set HTTP timeout in seconds (default: '10'). Define the HTTP timeout in seconds (default: '10').
=item B<--api-version> =item B<--api-version>
API version (default: 'v1'). Define the API version (default: 'v1').
=back =back

View File

@ -64,8 +64,8 @@ sub check_options {
command => $self->{option_results}->{command_plink} command => $self->{option_results}->{command_plink}
); );
$self->{option_results}->{command} = 'plink' $self->{option_results}->{command_plink} = 'plink'
if (!defined($self->{option_results}->{command}) || $self->{option_results}->{command} eq ''); if (!defined($self->{option_results}->{command_plink}) || $self->{option_results}->{command_plink} eq '');
} }
sub run { sub run {
@ -132,25 +132,25 @@ __END__
=head1 MODE =head1 MODE
Check Sun 'T1xxx', 'T2xxx' Hardware (through ALOM4v). Check Sun C<T1xxx>, C<T2xxx> management cards hardware (using C<ALOM4v>).
=over 8 =over 8
=item B<--hostname> =item B<--hostname>
Hostname to query. Define the hostname to query.
=item B<--username> =item B<--username>
ssh username. Define the ssh username.
=item B<--password> =item B<--password>
ssh password. Define the ssh password.
=item B<--command-plink> =item B<--command-plink>
Plink command (default: plink). Use to set a path. Define the C<plink> command (default: C<plink>).
=item B<--timeout> =item B<--timeout>

View File

@ -71,8 +71,8 @@ sub check_options {
command => $self->{option_results}->{command_plink} command => $self->{option_results}->{command_plink}
); );
$self->{option_results}->{command} = 'plink' $self->{option_results}->{command_plink} = 'plink'
if (!defined($self->{option_results}->{command}) || $self->{option_results}->{command} eq ''); if (!defined($self->{option_results}->{command_plink}) || $self->{option_results}->{command_plink} eq '');
} }
sub run { sub run {
@ -185,30 +185,30 @@ __END__
=head1 MODE =head1 MODE
Check Sun 'T3-x', 'T4-x' and 'T5xxx' Hardware (through ILOM). Check Sun C<T3-x>, C<T4-x> and C<T5xxx> management cards hardware (using C<ILOM>).
=over 8 =over 8
=item B<--hostname> =item B<--hostname>
Hostname to query. Define the hostname to query.
=item B<--username> =item B<--username>
ssh username. Define the ssh username.
=item B<--password> =item B<--password>
ssh password. Define the ssh password.
=item B<--command-plink>
Define the C<plink> command (default: C<plink>).
=item B<--memory> =item B<--memory>
Returns new errors (retention file is used by the following option). Returns new errors (retention file is used by the following option).
=item B<--command-plink>
Plink command (default: plink). Use to set a path.
=item B<--timeout> =item B<--timeout>
Timeout in seconds for the command (default: 30). Timeout in seconds for the command (default: 30).

View File

@ -49,11 +49,11 @@ hashicorpvault
HPE HPE
Huawei Huawei
ifAlias ifAlias
includeAllDisks
ifDesc ifDesc
ifName ifName
IMEI IMEI
in-bcast in-bcast
includeAllDisks
in-crc in-crc
in-fcserror in-fcserror
in-mcast in-mcast
@ -128,6 +128,7 @@ RRDCached
Sansymphony Sansymphony
SAS SAS
scenarii scenarii
SFDC
sfp.temperature sfp.temperature
SkyHigh SkyHigh
SNMP SNMP
@ -144,8 +145,8 @@ Teldat
timeframe timeframe
TiMOS TiMOS
tmnxSasAlarmInputDescription tmnxSasAlarmInputDescription
total-oper-up
total-oper-down total-oper-down
total-oper-up
TrendMicro TrendMicro
tsdb-version tsdb-version
UCD UCD