diff --git a/pandora_server/lib/PandoraFMS/DiscoveryServer.pm b/pandora_server/lib/PandoraFMS/DiscoveryServer.pm index 76a8ac766c..c8b40d1848 100644 --- a/pandora_server/lib/PandoraFMS/DiscoveryServer.pm +++ b/pandora_server/lib/PandoraFMS/DiscoveryServer.pm @@ -202,15 +202,15 @@ sub data_consumer ($$) { || $cnf_extra{'cloud_util_path'} ne $ENV{'AWS_SECRET_ACCESS_KEY'}) { # Environmental data is out of date. Create a tmp file to manage # credentials. Perl limitation. We cannot update ENV here. - $cnf_extra{'cred_file'} = $pa_config->{'temporal'} . '/tmp_discovery.' . md5($task->{'id_rt'} . $task->{'name'} . time()); + $cnf_extra{'creds_file'} = $pa_config->{'temporal'} . '/tmp_discovery.' . md5($task->{'id_rt'} . $task->{'name'} . time()); eval { - open(my $__file_cfg, '> '. $cnf_extra{'cred_file'}) or die($!); + open(my $__file_cfg, '> '. $cnf_extra{'creds_file'}) or die($!); print $__file_cfg $cnf_extra{'aws_access_key_id'} . "\n"; print $__file_cfg $cnf_extra{'aws_secret_access_key'} . "\n"; close($__file_cfg); set_file_permissions( $pa_config, - $cnf_extra{'cred_file'}, + $cnf_extra{'creds_file'}, "0600" ); }; @@ -270,9 +270,9 @@ sub data_consumer ($$) { $recon->scan(); # Clean tmp file. - if (defined($cnf_extra{'cred_file'}) - && -f $cnf_extra{'cred_file'}) { - unlink($cnf_extra{'cred_file'}); + if (defined($cnf_extra{'creds_file'}) + && -f $cnf_extra{'creds_file'}) { + unlink($cnf_extra{'creds_file'}); } }; if ($@) { diff --git a/pandora_server/lib/PandoraFMS/Recon/Base.pm b/pandora_server/lib/PandoraFMS/Recon/Base.pm index 58e0eb8543..23532d843b 100644 --- a/pandora_server/lib/PandoraFMS/Recon/Base.pm +++ b/pandora_server/lib/PandoraFMS/Recon/Base.pm @@ -1456,6 +1456,7 @@ sub cloud_scan($) { aws_access_key_id => $self->{'aws_access_key_id'}, aws_secret_access_key => $self->{'aws_secret_access_key'}, cloud_util_path => $self->{'cloud_util_path'}, + creds_file => $self->{'creds_file'}, parent => $self ]