Improve validation for attributes which must not be 'null'

This commit is contained in:
Gunnar Beutner 2017-05-30 14:47:28 +02:00
parent c9039e1850
commit 7ca485f63c
5 changed files with 6 additions and 6 deletions

View File

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

View File

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

View File

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

View File

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

View File

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