mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-23 05:34:48 +02:00
Drop useless CompatUtility::GetCustomAttributeConfig() wrapper
This commit is contained in:
parent
b5f5d167dc
commit
f2fe165ccb
@ -227,7 +227,7 @@ void DbObject::SendVarsConfigUpdateHeavy()
|
|||||||
query2.WhereCriteria->Set("object_id", obj);
|
query2.WhereCriteria->Set("object_id", obj);
|
||||||
queries.emplace_back(std::move(query2));
|
queries.emplace_back(std::move(query2));
|
||||||
|
|
||||||
Dictionary::Ptr vars = CompatUtility::GetCustomAttributeConfig(custom_var_object);
|
Dictionary::Ptr vars = custom_var_object->GetVars();
|
||||||
|
|
||||||
if (vars) {
|
if (vars) {
|
||||||
ObjectLock olock (vars);
|
ObjectLock olock (vars);
|
||||||
@ -274,7 +274,7 @@ void DbObject::SendVarsStatusUpdate()
|
|||||||
if (!custom_var_object)
|
if (!custom_var_object)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Dictionary::Ptr vars = CompatUtility::GetCustomAttributeConfig(custom_var_object);
|
Dictionary::Ptr vars = custom_var_object->GetVars();
|
||||||
|
|
||||||
if (vars) {
|
if (vars) {
|
||||||
std::vector<DbQuery> queries;
|
std::vector<DbQuery> queries;
|
||||||
|
@ -233,17 +233,6 @@ int CompatUtility::GetCheckableInNotificationPeriod(const Checkable::Ptr& checka
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* vars attr */
|
|
||||||
Dictionary::Ptr CompatUtility::GetCustomAttributeConfig(const CustomVarObject::Ptr& object)
|
|
||||||
{
|
|
||||||
Dictionary::Ptr vars = object->GetVars();
|
|
||||||
|
|
||||||
if (!vars)
|
|
||||||
return nullptr;
|
|
||||||
|
|
||||||
return vars;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* notifications */
|
/* notifications */
|
||||||
int CompatUtility::GetCheckableNotificationLastNotification(const Checkable::Ptr& checkable)
|
int CompatUtility::GetCheckableNotificationLastNotification(const Checkable::Ptr& checkable)
|
||||||
{
|
{
|
||||||
|
@ -78,9 +78,6 @@ public:
|
|||||||
static std::set<User::Ptr> GetCheckableNotificationUsers(const Checkable::Ptr& checkable);
|
static std::set<User::Ptr> GetCheckableNotificationUsers(const Checkable::Ptr& checkable);
|
||||||
static std::set<UserGroup::Ptr> GetCheckableNotificationUserGroups(const Checkable::Ptr& checkable);
|
static std::set<UserGroup::Ptr> GetCheckableNotificationUserGroups(const Checkable::Ptr& checkable);
|
||||||
|
|
||||||
/* custom attribute */
|
|
||||||
static Dictionary::Ptr GetCustomAttributeConfig(const CustomVarObject::Ptr& object);
|
|
||||||
|
|
||||||
/* check result */
|
/* check result */
|
||||||
static String GetCheckResultOutput(const CheckResult::Ptr& cr);
|
static String GetCheckResultOutput(const CheckResult::Ptr& cr);
|
||||||
static String GetCheckResultLongOutput(const CheckResult::Ptr& cr);
|
static String GetCheckResultLongOutput(const CheckResult::Ptr& cr);
|
||||||
|
@ -103,7 +103,7 @@ Value CommandsTable::CustomVariableNamesAccessor(const Value& row)
|
|||||||
|
|
||||||
{
|
{
|
||||||
ObjectLock olock(command);
|
ObjectLock olock(command);
|
||||||
vars = CompatUtility::GetCustomAttributeConfig(command);
|
vars = command->GetVars();
|
||||||
}
|
}
|
||||||
|
|
||||||
Array::Ptr cv = new Array();
|
Array::Ptr cv = new Array();
|
||||||
@ -132,7 +132,7 @@ Value CommandsTable::CustomVariableValuesAccessor(const Value& row)
|
|||||||
|
|
||||||
{
|
{
|
||||||
ObjectLock olock(command);
|
ObjectLock olock(command);
|
||||||
vars = CompatUtility::GetCustomAttributeConfig(command);
|
vars = command->GetVars();
|
||||||
}
|
}
|
||||||
|
|
||||||
Array::Ptr cv = new Array();
|
Array::Ptr cv = new Array();
|
||||||
@ -161,7 +161,7 @@ Value CommandsTable::CustomVariablesAccessor(const Value& row)
|
|||||||
|
|
||||||
{
|
{
|
||||||
ObjectLock olock(command);
|
ObjectLock olock(command);
|
||||||
vars = CompatUtility::GetCustomAttributeConfig(command);
|
vars = command->GetVars();
|
||||||
}
|
}
|
||||||
|
|
||||||
Array::Ptr cv = new Array();
|
Array::Ptr cv = new Array();
|
||||||
|
@ -207,7 +207,7 @@ Value ContactsTable::CustomVariableNamesAccessor(const Value& row)
|
|||||||
|
|
||||||
{
|
{
|
||||||
ObjectLock olock(user);
|
ObjectLock olock(user);
|
||||||
vars = CompatUtility::GetCustomAttributeConfig(user);
|
vars = user->GetVars();
|
||||||
}
|
}
|
||||||
|
|
||||||
Array::Ptr cv = new Array();
|
Array::Ptr cv = new Array();
|
||||||
@ -234,7 +234,7 @@ Value ContactsTable::CustomVariableValuesAccessor(const Value& row)
|
|||||||
|
|
||||||
{
|
{
|
||||||
ObjectLock olock(user);
|
ObjectLock olock(user);
|
||||||
vars = CompatUtility::GetCustomAttributeConfig(user);
|
vars = user->GetVars();
|
||||||
}
|
}
|
||||||
|
|
||||||
Array::Ptr cv = new Array();
|
Array::Ptr cv = new Array();
|
||||||
@ -264,7 +264,7 @@ Value ContactsTable::CustomVariablesAccessor(const Value& row)
|
|||||||
|
|
||||||
{
|
{
|
||||||
ObjectLock olock(user);
|
ObjectLock olock(user);
|
||||||
vars = CompatUtility::GetCustomAttributeConfig(user);
|
vars = user->GetVars();
|
||||||
}
|
}
|
||||||
|
|
||||||
Array::Ptr cv = new Array();
|
Array::Ptr cv = new Array();
|
||||||
@ -299,7 +299,7 @@ Value ContactsTable::CVIsJsonAccessor(const Value& row)
|
|||||||
|
|
||||||
{
|
{
|
||||||
ObjectLock olock(user);
|
ObjectLock olock(user);
|
||||||
vars = CompatUtility::GetCustomAttributeConfig(user);
|
vars = user->GetVars();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!vars)
|
if (!vars)
|
||||||
|
@ -1021,7 +1021,7 @@ Value HostsTable::CustomVariableNamesAccessor(const Value& row)
|
|||||||
|
|
||||||
{
|
{
|
||||||
ObjectLock olock(host);
|
ObjectLock olock(host);
|
||||||
vars = CompatUtility::GetCustomAttributeConfig(host);
|
vars = host->GetVars();
|
||||||
}
|
}
|
||||||
|
|
||||||
Array::Ptr cv = new Array();
|
Array::Ptr cv = new Array();
|
||||||
@ -1048,7 +1048,7 @@ Value HostsTable::CustomVariableValuesAccessor(const Value& row)
|
|||||||
|
|
||||||
{
|
{
|
||||||
ObjectLock olock(host);
|
ObjectLock olock(host);
|
||||||
vars = CompatUtility::GetCustomAttributeConfig(host);
|
vars = host->GetVars();
|
||||||
}
|
}
|
||||||
|
|
||||||
Array::Ptr cv = new Array();
|
Array::Ptr cv = new Array();
|
||||||
@ -1078,7 +1078,7 @@ Value HostsTable::CustomVariablesAccessor(const Value& row)
|
|||||||
|
|
||||||
{
|
{
|
||||||
ObjectLock olock(host);
|
ObjectLock olock(host);
|
||||||
vars = CompatUtility::GetCustomAttributeConfig(host);
|
vars = host->GetVars();
|
||||||
}
|
}
|
||||||
|
|
||||||
Array::Ptr cv = new Array();
|
Array::Ptr cv = new Array();
|
||||||
@ -1113,7 +1113,7 @@ Value HostsTable::CVIsJsonAccessor(const Value& row)
|
|||||||
|
|
||||||
{
|
{
|
||||||
ObjectLock olock(host);
|
ObjectLock olock(host);
|
||||||
vars = CompatUtility::GetCustomAttributeConfig(host);
|
vars = host->GetVars();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!vars)
|
if (!vars)
|
||||||
|
@ -1043,7 +1043,7 @@ Value ServicesTable::CustomVariableNamesAccessor(const Value& row)
|
|||||||
|
|
||||||
{
|
{
|
||||||
ObjectLock olock(service);
|
ObjectLock olock(service);
|
||||||
vars = CompatUtility::GetCustomAttributeConfig(service);
|
vars = service->GetVars();
|
||||||
}
|
}
|
||||||
|
|
||||||
Array::Ptr cv = new Array();
|
Array::Ptr cv = new Array();
|
||||||
@ -1070,7 +1070,7 @@ Value ServicesTable::CustomVariableValuesAccessor(const Value& row)
|
|||||||
|
|
||||||
{
|
{
|
||||||
ObjectLock olock(service);
|
ObjectLock olock(service);
|
||||||
vars = CompatUtility::GetCustomAttributeConfig(service);
|
vars = service->GetVars();
|
||||||
}
|
}
|
||||||
|
|
||||||
Array::Ptr cv = new Array();
|
Array::Ptr cv = new Array();
|
||||||
@ -1100,7 +1100,7 @@ Value ServicesTable::CustomVariablesAccessor(const Value& row)
|
|||||||
|
|
||||||
{
|
{
|
||||||
ObjectLock olock(service);
|
ObjectLock olock(service);
|
||||||
vars = CompatUtility::GetCustomAttributeConfig(service);
|
vars = service->GetVars();
|
||||||
}
|
}
|
||||||
|
|
||||||
Array::Ptr cv = new Array();
|
Array::Ptr cv = new Array();
|
||||||
@ -1135,7 +1135,7 @@ Value ServicesTable::CVIsJsonAccessor(const Value& row)
|
|||||||
|
|
||||||
{
|
{
|
||||||
ObjectLock olock(service);
|
ObjectLock olock(service);
|
||||||
vars = CompatUtility::GetCustomAttributeConfig(service);
|
vars = service->GetVars();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!vars)
|
if (!vars)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user