relax connect_info for passed-through DBI attributes

agranig/2.004-ramoptimized
Lars Dieckow 12 years ago
parent 8f5278dc9b
commit a667bdefa5

@ -20,8 +20,7 @@ class_has('config', is => 'rw', isa => 'NGCP::Schema::Config', lazy => 1, defaul
}); });
method connection { method connection {
my %connect_info = %{ $self->config->as_hash->{accountingdb} }; $self->SUPER::connection($self->config->as_hash->{accountingdb});
$self->SUPER::connection(@connect_info{qw(dsn username password)});
} }
__PACKAGE__->meta->make_immutable(inline_constructor => 0); __PACKAGE__->meta->make_immutable(inline_constructor => 0);

@ -27,8 +27,7 @@ has('provisioning', is => 'rw', isa => 'NGCP::Schema::provisioning', lazy => 1,
}); });
method connection { method connection {
my %connect_info = %{ $self->config->as_hash->{billingdb} }; $self->SUPER::connection($self->config->as_hash->{billingdb});
$self->SUPER::connection(@connect_info{qw(dsn username password)});
} }
method get_domain($reseller_id, $domain) { method get_domain($reseller_id, $domain) {

@ -20,8 +20,7 @@ class_has('config', is => 'rw', isa => 'NGCP::Schema::Config', lazy => 1, defaul
}); });
method connection { method connection {
my %connect_info = %{ $self->config->as_hash->{carrierdb} }; $self->SUPER::connection($self->config->as_hash->{carrierdb});
$self->SUPER::connection(@connect_info{qw(dsn username password)});
} }
__PACKAGE__->meta->make_immutable(inline_constructor => 0); __PACKAGE__->meta->make_immutable(inline_constructor => 0);

@ -20,8 +20,7 @@ class_has('config', is => 'rw', isa => 'NGCP::Schema::Config', lazy => 1, defaul
}); });
method connection { method connection {
my %connect_info = %{ $self->config->as_hash->{kamailiodb} }; $self->SUPER::connection($self->config->as_hash->{kamailiodb});
$self->SUPER::connection(@connect_info{qw(dsn username password)});
} }
__PACKAGE__->meta->make_immutable(inline_constructor => 0); __PACKAGE__->meta->make_immutable(inline_constructor => 0);

@ -20,8 +20,7 @@ class_has('config', is => 'rw', isa => 'NGCP::Schema::Config', lazy => 1, defaul
}); });
method connection { method connection {
my %connect_info = %{ $self->config->as_hash->{ngcpdb} }; $self->SUPER::connection($self->config->as_hash->{ngcpdb});
$self->SUPER::connection(@connect_info{qw(dsn username password)});
} }
__PACKAGE__->meta->make_immutable(inline_constructor => 0); __PACKAGE__->meta->make_immutable(inline_constructor => 0);

@ -23,8 +23,7 @@ class_has('config', is => 'rw', isa => 'NGCP::Schema::Config', lazy => 1, defaul
has('validator', is => 'rw', isa => 'NGCP::Schema', lazy => 1, default => sub { return NGCP::Schema->new; }); has('validator', is => 'rw', isa => 'NGCP::Schema', lazy => 1, default => sub { return NGCP::Schema->new; });
method connection { method connection {
my %connect_info = %{ $self->config->as_hash->{provisioningdb} }; $self->SUPER::connection($self->config->as_hash->{provisioningdb});
$self->SUPER::connection(@connect_info{qw(dsn username password)});
} }
method _get_domain_id($domain) { method _get_domain_id($domain) {

@ -20,8 +20,7 @@ class_has('config', is => 'rw', isa => 'NGCP::Schema::Config', lazy => 1, defaul
}); });
method connection { method connection {
my %connect_info = %{ $self->config->as_hash->{sipstatsdb} }; $self->SUPER::connection($self->config->as_hash->{sipstatsdb});
$self->SUPER::connection(@connect_info{qw(dsn username password)});
} }
__PACKAGE__->meta->make_immutable(inline_constructor => 0); __PACKAGE__->meta->make_immutable(inline_constructor => 0);

Loading…
Cancel
Save