From dd81333233b2effe8640f52299c3500bfdbd2e5c Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Thu, 31 Jan 2019 13:15:24 +0100 Subject: [PATCH] WIP: centreon-vmware 3.0.0 --- .../vmware/src/centreon/script/centreon_vmware.pm | 11 +++-------- connectors/vmware/src/centreon/vmware/connector.pm | 1 - .../vmware/src/centreon/{common => vmware}/logger.pm | 6 +++--- connectors/vmware/src/centreon/{ => vmware}/script.pm | 6 +++--- 4 files changed, 9 insertions(+), 15 deletions(-) rename connectors/vmware/src/centreon/{common => vmware}/logger.pm (97%) rename connectors/vmware/src/centreon/{ => vmware}/script.pm (94%) diff --git a/connectors/vmware/src/centreon/script/centreon_vmware.pm b/connectors/vmware/src/centreon/script/centreon_vmware.pm index b10e152ed..c5ebc78e2 100644 --- a/connectors/vmware/src/centreon/script/centreon_vmware.pm +++ b/connectors/vmware/src/centreon/script/centreon_vmware.pm @@ -29,7 +29,7 @@ use File::Basename; use Digest::MD5 qw(md5_hex); use POSIX ":sys_wait_h"; use JSON::XS; -use centreon::script; +use centreon::vmware::script; use centreon::vmware::common; use centreon::vmware::connector; @@ -51,7 +51,7 @@ BEGIN { }; } -use base qw(centreon::script); +use base qw(centreon::vmware::script); use vars qw(%centreon_vmware_config); my $VERSION = "3.0.0"; @@ -98,12 +98,7 @@ my @load_modules = ( sub new { my $class = shift; - my $self = $class->SUPER::new("centreon_vmware", - # we keep it if we use centreon common library - centreon_db_conn => 0, - centstorage_db_conn => 0, - noconfig => 1 - ); + my $self = $class->SUPER::new("centreon_vmware"); bless $self, $class; $self->add_options( diff --git a/connectors/vmware/src/centreon/vmware/connector.pm b/connectors/vmware/src/centreon/vmware/connector.pm index b0503b973..f559ac9e7 100644 --- a/connectors/vmware/src/centreon/vmware/connector.pm +++ b/connectors/vmware/src/centreon/vmware/connector.pm @@ -26,7 +26,6 @@ use ZMQ::LibZMQ4; use ZMQ::Constants qw(:all); use File::Basename; use POSIX ":sys_wait_h"; -use centreon::script; use centreon::vmware::common; my %handlers = (TERM => {}, HUP => {}, CHLD => {}); diff --git a/connectors/vmware/src/centreon/common/logger.pm b/connectors/vmware/src/centreon/vmware/logger.pm similarity index 97% rename from connectors/vmware/src/centreon/common/logger.pm rename to connectors/vmware/src/centreon/vmware/logger.pm index 1f726c128..ab59dad93 100644 --- a/connectors/vmware/src/centreon/common/logger.pm +++ b/connectors/vmware/src/centreon/vmware/logger.pm @@ -16,11 +16,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -package centreon::common::logger; +package centreon::vmware::logger; =head1 NOM -centreon::common::logger - Simple logging module +centreon::vmware::logger - Simple logging module =head1 SYNOPSIS @@ -31,7 +31,7 @@ centreon::common::logger - Simple logging module use centreon::polling; - my $logger = new centreon::common::logger(); + my $logger = new centreon::vmware::logger(); $logger->writeLogInfo("information"); diff --git a/connectors/vmware/src/centreon/script.pm b/connectors/vmware/src/centreon/vmware/script.pm similarity index 94% rename from connectors/vmware/src/centreon/script.pm rename to connectors/vmware/src/centreon/vmware/script.pm index 5f83dc1c4..b1b9aa8c6 100644 --- a/connectors/vmware/src/centreon/script.pm +++ b/connectors/vmware/src/centreon/vmware/script.pm @@ -16,14 +16,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -package centreon::script; +package centreon::vmware::script; use strict; use warnings; use FindBin; use Getopt::Long; use Pod::Usage; -use centreon::common::logger; +use centreon::vmware::logger; $SIG{__DIE__} = sub { return unless defined $^S and $^S == 0; # Ignore errors in eval @@ -44,7 +44,7 @@ sub new { bless $self, $class; $self->{name} = $name; - $self->{logger} = centreon::common::logger->new(); + $self->{logger} = centreon::vmware::logger->new(); $self->{options} = { "logfile=s" => \$self->{log_file}, "severity=s" => \$self->{severity},