Commit 538989fe authored by Francesc Guasch's avatar Francesc Guasch
Browse files

init config is global

parent 59336cfa
......@@ -116,9 +116,9 @@ Internal constructor
sub BUILD {
my $self = shift;
if ($self->config()) {
$self->_init_config($self->config);
_init_config($self->config);
} else {
$self->_init_config($FILE_CONFIG) if $FILE_CONFIG && -e $FILE_CONFIG;
_init_config($FILE_CONFIG) if $FILE_CONFIG && -e $FILE_CONFIG;
}
if ( $self->connector ) {
......@@ -715,8 +715,7 @@ sub display_ip {
}
sub _init_config {
my $self = shift;
my $file = shift;
my $file = shift or confess "ERROR: Missing config file";
my $connector = shift;
confess "Deprecated connector" if $connector;
......@@ -728,18 +727,14 @@ sub _init_config {
if $CONFIG->{limit_process} && $CONFIG->{limit_process}>1;
# $CONNECTOR = ( $connector or _connect_dbh());
$self->warn_error($CONFIG->{warn_error})
if defined $CONFIG->{warn_error};
$self->_init_config_vm();
_init_config_vm();
}
sub _init_config_vm {
my $self = shift;
for my $vm ( @{$CONFIG->{vm}} ) {
warn "$vm not available in this system.\n".($ERROR_VM{$vm})
if !$VALID_VM{$vm} && $self->warn_error();
if !$VALID_VM{$vm} && $0 !~ /\.t$/;
}
delete $VALID_VM{Void}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment