mirror of https://github.com/Icinga/icinga2.git
parent
0449c66afc
commit
9413466cef
|
@ -126,7 +126,7 @@ void DynamicObject::InternalApplyUpdate(const Dictionary::Ptr& serializedUpdate,
|
|||
if (!HasAttribute(it->first))
|
||||
RegisterAttribute(it->first, static_cast<DynamicAttributeType>(type));
|
||||
|
||||
InternalSetAttribute(it->first, data, tx, suppressEvents);
|
||||
InternalSetAttribute(it->first, data, tx, suppressEvents, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -160,7 +160,7 @@ Value DynamicObject::Get(const String& name) const
|
|||
}
|
||||
|
||||
void DynamicObject::InternalSetAttribute(const String& name, const Value& data,
|
||||
double tx, bool suppressEvent)
|
||||
double tx, bool suppressEvent, bool allowEditConfig)
|
||||
{
|
||||
DynamicAttribute attr;
|
||||
attr.Type = Attribute_Transient;
|
||||
|
@ -172,6 +172,9 @@ void DynamicObject::InternalSetAttribute(const String& name, const Value& data,
|
|||
|
||||
Value oldValue;
|
||||
|
||||
if (!allowEditConfig && (tt.first->second.Type & Attribute_Config))
|
||||
throw_exception(runtime_error("Config properties are immutable: '" + name + "'."));
|
||||
|
||||
if (!tt.second && tx >= tt.first->second.Tx) {
|
||||
oldValue = tt.first->second.Data;
|
||||
tt.first->second.Data = data;
|
||||
|
|
|
@ -145,7 +145,7 @@ protected:
|
|||
virtual void OnAttributeChanged(const String& name, const Value& oldValue);
|
||||
|
||||
private:
|
||||
void InternalSetAttribute(const String& name, const Value& data, double tx, bool suppressEvent = false);
|
||||
void InternalSetAttribute(const String& name, const Value& data, double tx, bool suppressEvent = false, bool allowEditConfig = false);
|
||||
Value InternalGetAttribute(const String& name) const;
|
||||
|
||||
AttributeMap m_Attributes;
|
||||
|
|
Loading…
Reference in New Issue