Skip to content
Snippets Groups Projects
Commit 7ea3b965 authored by Guillaume ROUSSE's avatar Guillaume ROUSSE
Browse files

fix database definition check

parent cc4e368c
No related branches found
No related tags found
No related merge requests found
......@@ -91,16 +91,7 @@ sub new {
);
}
if ($self->{configuration}->{logger}) {
AccountManager::DB->register_db(
driver => $self->{configuration}->{database}->{type},
database => $self->{configuration}->{database}->{name},
host => $self->{configuration}->{database}->{host},
username => $self->{configuration}->{database}->{username},
password => $self->{configuration}->{database}->{password},
options => [ split(/, */, $self->{configuration}->{database}->{options}) ]
);
} else {
if (!$self->{configuration}->{database}) {
$self->{logger}->fatal(
"No database defined in configuration, aborting"
);
......@@ -111,6 +102,15 @@ sub new {
errors => [ 'internal' ]
}
);
} else {
AccountManager::DB->register_db(
driver => $self->{configuration}->{database}->{type},
database => $self->{configuration}->{database}->{name},
host => $self->{configuration}->{database}->{host},
username => $self->{configuration}->{database}->{username},
password => $self->{configuration}->{database}->{password},
options => [ split(/, */, $self->{configuration}->{database}->{options}) ]
);
}
$self->{db} = AccountManager::DB->new();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment