mirror of https://github.com/Icinga/icinga2.git
Bugfixes for the type validation feature.
This commit is contained in:
parent
33aba14197
commit
628d8374c7
|
@ -34,7 +34,7 @@ type Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
type Logger {
|
type Logger {
|
||||||
string type,
|
string "type",
|
||||||
string path,
|
string path,
|
||||||
string severity
|
string severity
|
||||||
}
|
}
|
||||||
|
@ -71,7 +71,7 @@ type IcingaApplication {
|
||||||
string service,
|
string service,
|
||||||
string pid_path,
|
string pid_path,
|
||||||
string state_path,
|
string state_path,
|
||||||
string macros
|
dictionary macros
|
||||||
}
|
}
|
||||||
|
|
||||||
type Service {
|
type Service {
|
||||||
|
@ -104,5 +104,8 @@ type ServiceGroup {
|
||||||
type Endpoint {
|
type Endpoint {
|
||||||
string node,
|
string node,
|
||||||
string service,
|
string service,
|
||||||
number local
|
number "local"
|
||||||
|
}
|
||||||
|
|
||||||
|
type TimePeriod {
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,8 +62,8 @@ void ConfigType::ValidateObject(const DynamicObject::Ptr& object) const
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!ValidateAttribute(it->first, it->second.Data))
|
if (!ValidateAttribute(it->first, it->second.Data))
|
||||||
Logger::Write(LogWarning, "base", "Configuration attribute '" + it->first +
|
Logger::Write(LogWarning, "config", "Configuration attribute '" + it->first +
|
||||||
"' on object '" + object->GetName() + "' of type '" + object->GetType()->GetName() + "' is unknown.");
|
"' on object '" + object->GetName() + "' of type '" + object->GetType()->GetName() + "' is unknown or contains an invalid type.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,9 @@ bool TypeRule::Matches(const String& name, const Value& value) const
|
||||||
if (!Utility::Match(m_NamePattern, name))
|
if (!Utility::Match(m_NamePattern, name))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (value.IsEmpty())
|
||||||
|
return true;
|
||||||
|
|
||||||
switch (m_Type) {
|
switch (m_Type) {
|
||||||
case TypeAny:
|
case TypeAny:
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue