Skip to content

Commit

Permalink
fix(vmware-daemon): fix the case-sensitiveness regression on containe…
Browse files Browse the repository at this point in the history
…rs (#5247)
  • Loading branch information
omercier committed Oct 21, 2024
1 parent db9a48a commit a842626
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
4 changes: 4 additions & 0 deletions connectors/vmware/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2024-10-18 Olivier Mercier <[email protected]> - 3.3.2
* Fix: regression of case sensitiveness for container names fixed
* Enhancement: log messages related to the vault have been downgraded from error to info level or explained as safe to ignore if not using the vault

2024-10-10 Olivier Mercier <[email protected]> - 3.3.1
* Fix: add missing centreonvault.pm file to packaging

Expand Down
9 changes: 8 additions & 1 deletion connectors/vmware/src/centreon/script/centreon_vmware.pm
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ BEGIN {

use base qw(centreon::vmware::script);

my $VERSION = '3.3.1';
my $VERSION = '3.3.2';
my %handlers = (TERM => {}, HUP => {}, CHLD => {});

my @load_modules = (
Expand Down Expand Up @@ -158,6 +158,13 @@ sub read_configuration {
our %centreon_vmware_config;
# loads the .pm configuration (compile time)
require($self->{opt_extra}) or $self->{logger}->writeLogFatal("There has been an error while requiring file " . $self->{opt_extra});
# We want all the keys to be lowercase
for my $conf_key (keys %{$centreon_vmware_config{vsphere_server}}) {
if ($conf_key ne lc($conf_key)) {
$self->{logger}->writeLogDebug("The container $conf_key has capital letters. We convert it to lower case.");
$centreon_vmware_config{vsphere_server}->{lc($conf_key)} = delete $centreon_vmware_config{vsphere_server}->{$conf_key};
}
}
# Concatenation of the default parameters with the ones from the config file
$self->{centreon_vmware_config} = {%{$self->{centreon_vmware_default_config}}, %centreon_vmware_config};
} elsif ($self->{opt_extra} =~ /.*\.json$/i) {
Expand Down
4 changes: 2 additions & 2 deletions connectors/vmware/src/centreon/script/centreonvault.pm
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ sub new {

if ( !$self->init() ) {
$self->{enabled} = 0;
$self->{logger}->writeLogError("An error occurred in init() method. Centreonvault cannot be used.");
$self->{logger}->writeLogInfo("Something happened during init() method that makes Centreonvault not usable. Ignore this if you don't use Centreonvault.");
}
return $self;
}
Expand Down Expand Up @@ -86,7 +86,7 @@ sub check_options {
}
if ( ! -f $self->{config_file} ) {
$self->{logger}->writeLogError("The given configuration file " . $self->{config_file}
. " does not exist. Centreonvault cannot be used.");
. " does not exist. Passwords won't be retrieved from Centreonvault. Ignore this if you don't use Centreonvault.");
return undef;
}

Expand Down
2 changes: 1 addition & 1 deletion connectors/vmware/src/centreon/vmware/common.pm
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ sub init_response {
my (%options) = @_;

$manager_response->{code} = 0;
$manager_response->{vmware_connector_version} = '3.3.0';
$manager_response->{vmware_connector_version} = '3.3.2';
$manager_response->{short_message} = 'OK';
$manager_response->{extra_message} = '';
$manager_response->{identity} = $options{identity} if (defined($options{identity}));
Expand Down

0 comments on commit a842626

Please sign in to comment.