From 9de7da4d2a8e639f0819def441cd01a50e0510eb Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Tue, 10 Feb 2015 08:53:15 +0100 Subject: [PATCH] Update validators for CustomVarObject fixes #7542 --- lib/config/base-type.conf | 2 -- lib/icinga/icinga-type.conf | 24 ++++++++++++++---------- lib/icinga/icingastatuswriter.ti | 2 +- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/lib/config/base-type.conf b/lib/config/base-type.conf index 556e7247c..2b38c736c 100644 --- a/lib/config/base-type.conf +++ b/lib/config/base-type.conf @@ -31,8 +31,6 @@ %attribute %array "templates" { %attribute %string "*" }, - - %attribute %dictionary "vars" } %type Logger { diff --git a/lib/icinga/icinga-type.conf b/lib/icinga/icinga-type.conf index 6cf117ecf..aa23acb0e 100644 --- a/lib/icinga/icinga-type.conf +++ b/lib/icinga/icinga-type.conf @@ -25,7 +25,11 @@ %attribute %number "update_interval" } -%type Checkable { +%type CustomVarObject { + %attribute %dictionary "vars", +} + +%type Checkable %inherits CustomVarObject { %validator "ValidateCheckableCheckInterval", %attribute %string "display_name", @@ -70,7 +74,7 @@ %attribute %string "address6", } -%type HostGroup { +%type HostGroup %inherits CustomVarObject { %attribute %string "display_name" %attribute %array "groups" { @@ -93,7 +97,7 @@ }, } -%type ServiceGroup { +%type ServiceGroup %inherits CustomVarObject { %attribute %string "display_name" %attribute %array "groups" { @@ -105,7 +109,7 @@ %attribute %string "action_url", } -%type Notification { +%type Notification %inherits CustomVarObject { %validator "ValidateNotificationFilters" %validator "ValidateNotificationUsers" @@ -143,7 +147,7 @@ %attribute %name(Endpoint) "command_endpoint", } -%type User { +%type User %inherits CustomVarObject { %validator "ValidateUserFilters" %attribute %string "display_name", @@ -165,7 +169,7 @@ %attribute %string "pager", } -%type UserGroup { +%type UserGroup %inherits CustomVarObject { %attribute %string "display_name", %attribute %array "groups" { @@ -173,7 +177,7 @@ }, } -%type TimePeriod { +%type TimePeriod %inherits CustomVarObject { %attribute %string "display_name", %require "update", @@ -187,7 +191,7 @@ /* } */ } -%type Command { +%type Command %inherits CustomVarObject { %validator "ValidateCommandAttributes", %require "execute", @@ -235,7 +239,7 @@ } -%type ScheduledDowntime { +%type ScheduledDowntime %inherits CustomVarObject { %require "host_name", %attribute %name(Host) "host_name", %attribute %string "service_name", @@ -257,7 +261,7 @@ }, } -%type Dependency { +%type Dependency %inherits CustomVarObject { %validator "ValidateDependencyFilters" %require "parent_host_name", diff --git a/lib/icinga/icingastatuswriter.ti b/lib/icinga/icingastatuswriter.ti index 2632646a4..60a833a6f 100644 --- a/lib/icinga/icingastatuswriter.ti +++ b/lib/icinga/icingastatuswriter.ti @@ -23,7 +23,7 @@ namespace icinga { -class IcingaStatusWriter : CustomVarObject +class IcingaStatusWriter : DynamicObject { [config] String status_path { default {{{ return Application::GetLocalStateDir() + "/cache/icinga2/status.json"; }}}