Skip to content
Snippets Groups Projects
Commit f6fc75db authored by Andreas Romeyke's avatar Andreas Romeyke
Browse files

- refactoring, extracted _overide_config()

parent 64861fcf
No related branches found
No related tags found
No related merge requests found
...@@ -61,9 +61,8 @@ sub load_cache_if_possible ($homestr) { ...@@ -61,9 +61,8 @@ sub load_cache_if_possible ($homestr) {
return 1; return 1;
} }
sub common_global_validate ($self, $opt, $args) { sub _override_config ($override, $opt) {
no warnings; #no warnings;
foreach my $override (qw(elasticsearch_host elasticsearch_port http_only permanent_volume)) {
if ( if (
(exists $opt->{$override}) (exists $opt->{$override})
and ($config{$override} ne $opt->{$override}) and ($config{$override} ne $opt->{$override})
...@@ -74,8 +73,14 @@ Hint: override local config with: ...@@ -74,8 +73,14 @@ Hint: override local config with:
HINT HINT
$config{$override} = $opt->{$override}; $config{$override} = $opt->{$override};
} }
#use warnings;
return 1;
}
sub common_global_validate ($self, $opt, $args) {
foreach my $override (qw(elasticsearch_host elasticsearch_port http_only permanent_volume)) {
_override_config($override, $opt);
} }
use warnings;
# option overrides config # option overrides config
$config{elasticsearch_protocol} = $config{http_only} ? 'http' : 'https'; $config{elasticsearch_protocol} = $config{http_only} ? 'http' : 'https';
foreach my $volume (@{ $SLUB::LZA::TA::config{permanent_volume} }) { foreach my $volume (@{ $SLUB::LZA::TA::config{permanent_volume} }) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment