Merge pull request #5308 from Icinga/fix/null-validation

Improve validation for attributes which must not be 'null'

fixes #5288
This commit is contained in:
Gunnar Beutner 2017-05-30 15:03:24 +02:00 committed by GitHub
commit e474d1572f
5 changed files with 6 additions and 6 deletions

View File

@ -31,7 +31,7 @@ abstract class DbConnection : ConfigObject
default {{{ return "icinga_"; }}} default {{{ return "icinga_"; }}}
}; };
[config] Dictionary::Ptr cleanup { [config, required] Dictionary::Ptr cleanup {
default {{{ return new Dictionary(); }}} default {{{ return new Dictionary(); }}}
}; };

View File

@ -32,7 +32,7 @@ class Host : Checkable
load_after Endpoint; load_after Endpoint;
load_after Zone; load_after Zone;
[config, no_user_modify] array(name(HostGroup)) groups { [config, no_user_modify, required] array(name(HostGroup)) groups {
default {{{ return new Array(); }}} default {{{ return new Array(); }}}
}; };

View File

@ -44,7 +44,7 @@ class Service : Checkable < ServiceNameComposer
load_after Host; load_after Host;
load_after Zone; load_after Zone;
[config, no_user_modify] array(name(ServiceGroup)) groups { [config, no_user_modify, required] array(name(ServiceGroup)) groups {
default {{{ return new Array(); }}} default {{{ return new Array(); }}}
}; };

View File

@ -40,10 +40,10 @@ class TimePeriod : CustomVarObject
[config] bool prefer_includes { [config] bool prefer_includes {
default {{{ return true; }}} default {{{ return true; }}}
}; };
[config] array(name(TimePeriod)) excludes { [config, required] array(name(TimePeriod)) excludes {
default {{{ return new Array(); }}} default {{{ return new Array(); }}}
}; };
[config] array(name(TimePeriod)) includes { [config, required] array(name(TimePeriod)) includes {
default {{{ return new Array(); }}} default {{{ return new Array(); }}}
}; };
[state, no_user_modify] Value valid_begin; [state, no_user_modify] Value valid_begin;

View File

@ -36,7 +36,7 @@ class User : CustomVarObject
return m_DisplayName; return m_DisplayName;
}}} }}}
}; };
[config, no_user_modify] array(name(UserGroup)) groups { [config, no_user_modify, required] array(name(UserGroup)) groups {
default {{{ return new Array(); }}} default {{{ return new Array(); }}}
}; };
[config, navigation] name(TimePeriod) period (PeriodRaw) { [config, navigation] name(TimePeriod) period (PeriodRaw) {