hardcoded new defaults
This commit is contained in:
parent
d8613d1379
commit
c9adcdab1e
18
sanoid
18
sanoid
|
@ -553,6 +553,18 @@ sub getsnaps {
|
||||||
####################################################################################
|
####################################################################################
|
||||||
####################################################################################
|
####################################################################################
|
||||||
|
|
||||||
|
sub verify_option_existence {
|
||||||
|
my ($hash, $key, $default) = @_;
|
||||||
|
|
||||||
|
if (! defined (%$hash{$key})) {
|
||||||
|
$hash->{$key} = $default;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
####################################################################################
|
||||||
|
####################################################################################
|
||||||
|
####################################################################################
|
||||||
|
|
||||||
sub init {
|
sub init {
|
||||||
my ($conf_file, $default_conf_file) = @_;
|
my ($conf_file, $default_conf_file) = @_;
|
||||||
my %config;
|
my %config;
|
||||||
|
@ -568,6 +580,12 @@ sub init {
|
||||||
my @istrue=(1,"true","True","TRUE","yes","Yes","YES","on","On","ON");
|
my @istrue=(1,"true","True","TRUE","yes","Yes","YES","on","On","ON");
|
||||||
my @isfalse=(0,"false","False","FALSE","no","No","NO","off","Off","OFF");
|
my @isfalse=(0,"false","False","FALSE","no","No","NO","off","Off","OFF");
|
||||||
|
|
||||||
|
# hardcoded defaults which may be missing from older default configuration file
|
||||||
|
verify_option_existence($defaults{'template_default'}, 'frequent_period', 15);
|
||||||
|
verify_option_existence($defaults{'template_default'}, 'frequently', 0);
|
||||||
|
verify_option_existence($defaults{'template_default'}, 'frequently_warn', 2000);
|
||||||
|
verify_option_existence($defaults{'template_default'}, 'frequently_crit', 8000);
|
||||||
|
|
||||||
foreach my $section (keys %ini) {
|
foreach my $section (keys %ini) {
|
||||||
|
|
||||||
# first up - die with honor if unknown parameters are set in any modules or templates by the user.
|
# first up - die with honor if unknown parameters are set in any modules or templates by the user.
|
||||||
|
|
Loading…
Reference in New Issue