TT#68300 Do not consider a missing configuration file fatal

We should not consider a missing configuration file a fatal problem,
now that we have defaults for almost every configuration setting,
and can override them at constructor time.

Change-Id: I371498e9d75e81c4c759012ec38b44d050bdea8f
changes/10/34110/5
Guillem Jover 6 years ago
parent 5a3346a5ac
commit 83d3657979

@ -16,8 +16,10 @@ sub _load_config_defaults {
my $cfg_file = '/etc/default/ngcp-api';
my $cfg;
$cfg = Config::Tiny->read($cfg_file)
or croak("Cannot read $cfg_file: $ERRNO");
if (-e $cfg_file) {
$cfg = Config::Tiny->read($cfg_file)
or croak("Cannot read $cfg_file: $ERRNO");
}
Readonly my $config => {
host => $cfg->{_}->{NGCP_API_IP} // '127.0.0.1',

Loading…
Cancel
Save