mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-21 12:44:58 +02:00
parent
9dd37cf9bc
commit
17b87c9b2a
@ -407,6 +407,30 @@ int CompatUtility::GetCheckableInNotificationPeriod(const Checkable::Ptr& checka
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* vars attr */
|
/* vars attr */
|
||||||
|
|
||||||
|
bool CompatUtility::IsLegacyAttribute(const String& name)
|
||||||
|
{
|
||||||
|
if (name == "address" ||
|
||||||
|
name == "address1" ||
|
||||||
|
name == "address2" ||
|
||||||
|
name == "address3" ||
|
||||||
|
name == "address4" ||
|
||||||
|
name == "address5" ||
|
||||||
|
name == "address6" || /* user, host */
|
||||||
|
name == "email" ||
|
||||||
|
name == "pager" ||
|
||||||
|
name == "notes" ||
|
||||||
|
name == "action_url" ||
|
||||||
|
name == "notes_url" ||
|
||||||
|
name == "icon_image" ||
|
||||||
|
name == "icon_image_alt" ||
|
||||||
|
name == "statusmap_image" ||
|
||||||
|
name == "2d_coords")
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
Dictionary::Ptr CompatUtility::GetCustomAttributeConfig(const DynamicObject::Ptr& object)
|
Dictionary::Ptr CompatUtility::GetCustomAttributeConfig(const DynamicObject::Ptr& object)
|
||||||
{
|
{
|
||||||
ASSERT(object->OwnsLock());
|
ASSERT(object->OwnsLock());
|
||||||
@ -421,17 +445,7 @@ Dictionary::Ptr CompatUtility::GetCustomAttributeConfig(const DynamicObject::Ptr
|
|||||||
ObjectLock olock(vars);
|
ObjectLock olock(vars);
|
||||||
BOOST_FOREACH(const Dictionary::Pair& kv, vars) {
|
BOOST_FOREACH(const Dictionary::Pair& kv, vars) {
|
||||||
if (!kv.first.IsEmpty()) {
|
if (!kv.first.IsEmpty()) {
|
||||||
if (kv.first != "address" &&
|
if (!IsLegacyAttribute(kv.first))
|
||||||
kv.first != "address6" &&
|
|
||||||
kv.first != "email" &&
|
|
||||||
kv.first != "pager" &&
|
|
||||||
kv.first != "notes" &&
|
|
||||||
kv.first != "action_url" &&
|
|
||||||
kv.first != "notes_url" &&
|
|
||||||
kv.first != "icon_image" &&
|
|
||||||
kv.first != "icon_image_alt" &&
|
|
||||||
kv.first != "statusmap_image" &&
|
|
||||||
kv.first != "2d_coords")
|
|
||||||
varsvars->Set(kv.first, kv.second);
|
varsvars->Set(kv.first, kv.second);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -113,6 +113,7 @@ public:
|
|||||||
static String GetCommandLine(const Command::Ptr& command);
|
static String GetCommandLine(const Command::Ptr& command);
|
||||||
|
|
||||||
/* custom attribute */
|
/* custom attribute */
|
||||||
|
static bool IsLegacyAttribute(const String& name);
|
||||||
static String GetCustomAttributeConfig(const DynamicObject::Ptr& object, const String& name);
|
static String GetCustomAttributeConfig(const DynamicObject::Ptr& object, const String& name);
|
||||||
static Dictionary::Ptr GetCustomAttributeConfig(const DynamicObject::Ptr& object);
|
static Dictionary::Ptr GetCustomAttributeConfig(const DynamicObject::Ptr& object);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user