mirror of https://github.com/Icinga/icinga2.git
parent
e1b2f1750d
commit
6518f78af0
|
@ -320,7 +320,12 @@ void Downtime::TriggerDowntime(void)
|
|||
{
|
||||
ObjectLock olock(triggers);
|
||||
BOOST_FOREACH(const String& triggerName, triggers) {
|
||||
Downtime::GetByName(triggerName)->TriggerDowntime();
|
||||
Downtime::Ptr downtime = Downtime::GetByName(triggerName);
|
||||
|
||||
if (!downtime)
|
||||
continue;
|
||||
|
||||
downtime->TriggerDowntime();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -76,9 +76,9 @@ class Downtime : ConfigObject < DowntimeNameComposer
|
|||
[state] double trigger_time;
|
||||
[config] bool fixed;
|
||||
[config] double duration;
|
||||
[state] name(Downtime) triggered_by;
|
||||
[config] name(Downtime) triggered_by;
|
||||
[config] String scheduled_by;
|
||||
[config] Array::Ptr triggers {
|
||||
[state] Array::Ptr triggers {
|
||||
default {{{ return new Array(); }}}
|
||||
};
|
||||
int legacy_id;
|
||||
|
|
|
@ -71,14 +71,14 @@ String ConfigObjectUtility::CreateObjectConfig(const Type::Ptr& type, const Stri
|
|||
|
||||
ObjectLock olock(attrs);
|
||||
BOOST_FOREACH(const Dictionary::Pair& kv, attrs) {
|
||||
int fid = type->GetFieldId(kv.first);
|
||||
int fid = type->GetFieldId(kv.first.SubStr(0, kv.first.FindFirstOf(".")));
|
||||
|
||||
if (fid < 0)
|
||||
BOOST_THROW_EXCEPTION(ScriptError("Invalid attribute specified: " + kv.first));
|
||||
|
||||
Field field = type->GetFieldInfo(fid);
|
||||
|
||||
if (field.Attributes & FANoUserModify)
|
||||
if (!(field.Attributes & FAConfig) || kv.first == "name")
|
||||
BOOST_THROW_EXCEPTION(ScriptError("Attribute is marked for internal use only and may not be set: " + kv.first));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue