mirror of https://github.com/Icinga/icinga2.git
Remove obsolete locks in Livestatus; apply style guide to DB IDO
This commit is contained in:
parent
403ab5c357
commit
50106057bf
|
@ -51,11 +51,10 @@ Dictionary::Ptr HostDbObject::GetConfigFields() const
|
|||
/* Compatibility fallback. */
|
||||
String displayName = host->GetDisplayName();
|
||||
|
||||
if (!displayName.IsEmpty()) {
|
||||
if (!displayName.IsEmpty())
|
||||
fields->Set("alias", displayName);
|
||||
} else {
|
||||
else
|
||||
fields->Set("alias", host->GetName());
|
||||
}
|
||||
|
||||
fields->Set("display_name", displayName);
|
||||
fields->Set("address", host->GetAddress());
|
||||
|
|
|
@ -99,12 +99,7 @@ Value CommandsTable::CustomVariableNamesAccessor(const Value& row)
|
|||
if (!command)
|
||||
return Empty;
|
||||
|
||||
Dictionary::Ptr vars;
|
||||
|
||||
{
|
||||
ObjectLock olock(command);
|
||||
vars = command->GetVars();
|
||||
}
|
||||
Dictionary::Ptr vars = command->GetVars();
|
||||
|
||||
Array::Ptr cv = new Array();
|
||||
|
||||
|
@ -128,12 +123,7 @@ Value CommandsTable::CustomVariableValuesAccessor(const Value& row)
|
|||
if (!command)
|
||||
return Empty;
|
||||
|
||||
Dictionary::Ptr vars;
|
||||
|
||||
{
|
||||
ObjectLock olock(command);
|
||||
vars = command->GetVars();
|
||||
}
|
||||
Dictionary::Ptr vars = command->GetVars();
|
||||
|
||||
Array::Ptr cv = new Array();
|
||||
|
||||
|
@ -157,12 +147,7 @@ Value CommandsTable::CustomVariablesAccessor(const Value& row)
|
|||
if (!command)
|
||||
return Empty;
|
||||
|
||||
Dictionary::Ptr vars;
|
||||
|
||||
{
|
||||
ObjectLock olock(command);
|
||||
vars = command->GetVars();
|
||||
}
|
||||
Dictionary::Ptr vars = command->GetVars();
|
||||
|
||||
Array::Ptr cv = new Array();
|
||||
|
||||
|
|
|
@ -203,12 +203,7 @@ Value ContactsTable::CustomVariableNamesAccessor(const Value& row)
|
|||
if (!user)
|
||||
return Empty;
|
||||
|
||||
Dictionary::Ptr vars;
|
||||
|
||||
{
|
||||
ObjectLock olock(user);
|
||||
vars = user->GetVars();
|
||||
}
|
||||
Dictionary::Ptr vars = user->GetVars();
|
||||
|
||||
Array::Ptr cv = new Array();
|
||||
|
||||
|
@ -230,12 +225,7 @@ Value ContactsTable::CustomVariableValuesAccessor(const Value& row)
|
|||
if (!user)
|
||||
return Empty;
|
||||
|
||||
Dictionary::Ptr vars;
|
||||
|
||||
{
|
||||
ObjectLock olock(user);
|
||||
vars = user->GetVars();
|
||||
}
|
||||
Dictionary::Ptr vars = user->GetVars();
|
||||
|
||||
Array::Ptr cv = new Array();
|
||||
|
||||
|
@ -260,12 +250,7 @@ Value ContactsTable::CustomVariablesAccessor(const Value& row)
|
|||
if (!user)
|
||||
return Empty;
|
||||
|
||||
Dictionary::Ptr vars;
|
||||
|
||||
{
|
||||
ObjectLock olock(user);
|
||||
vars = user->GetVars();
|
||||
}
|
||||
Dictionary::Ptr vars = user->GetVars();
|
||||
|
||||
Array::Ptr cv = new Array();
|
||||
|
||||
|
@ -295,12 +280,7 @@ Value ContactsTable::CVIsJsonAccessor(const Value& row)
|
|||
if (!user)
|
||||
return Empty;
|
||||
|
||||
Dictionary::Ptr vars;
|
||||
|
||||
{
|
||||
ObjectLock olock(user);
|
||||
vars = user->GetVars();
|
||||
}
|
||||
Dictionary::Ptr vars = user->GetVars();
|
||||
|
||||
if (!vars)
|
||||
return Empty;
|
||||
|
|
|
@ -1036,12 +1036,7 @@ Value HostsTable::CustomVariableNamesAccessor(const Value& row)
|
|||
if (!host)
|
||||
return Empty;
|
||||
|
||||
Dictionary::Ptr vars;
|
||||
|
||||
{
|
||||
ObjectLock olock(host);
|
||||
vars = host->GetVars();
|
||||
}
|
||||
Dictionary::Ptr vars = host->GetVars();
|
||||
|
||||
Array::Ptr cv = new Array();
|
||||
|
||||
|
@ -1063,12 +1058,7 @@ Value HostsTable::CustomVariableValuesAccessor(const Value& row)
|
|||
if (!host)
|
||||
return Empty;
|
||||
|
||||
Dictionary::Ptr vars;
|
||||
|
||||
{
|
||||
ObjectLock olock(host);
|
||||
vars = host->GetVars();
|
||||
}
|
||||
Dictionary::Ptr vars = host->GetVars();
|
||||
|
||||
Array::Ptr cv = new Array();
|
||||
|
||||
|
@ -1093,12 +1083,7 @@ Value HostsTable::CustomVariablesAccessor(const Value& row)
|
|||
if (!host)
|
||||
return Empty;
|
||||
|
||||
Dictionary::Ptr vars;
|
||||
|
||||
{
|
||||
ObjectLock olock(host);
|
||||
vars = host->GetVars();
|
||||
}
|
||||
Dictionary::Ptr vars = host->GetVars();
|
||||
|
||||
Array::Ptr cv = new Array();
|
||||
|
||||
|
@ -1128,12 +1113,7 @@ Value HostsTable::CVIsJsonAccessor(const Value& row)
|
|||
if (!host)
|
||||
return Empty;
|
||||
|
||||
Dictionary::Ptr vars;
|
||||
|
||||
{
|
||||
ObjectLock olock(host);
|
||||
vars = host->GetVars();
|
||||
}
|
||||
Dictionary::Ptr vars = host->GetVars();
|
||||
|
||||
if (!vars)
|
||||
return Empty;
|
||||
|
|
|
@ -1058,12 +1058,7 @@ Value ServicesTable::CustomVariableNamesAccessor(const Value& row)
|
|||
if (!service)
|
||||
return Empty;
|
||||
|
||||
Dictionary::Ptr vars;
|
||||
|
||||
{
|
||||
ObjectLock olock(service);
|
||||
vars = service->GetVars();
|
||||
}
|
||||
Dictionary::Ptr vars = service->GetVars();
|
||||
|
||||
Array::Ptr cv = new Array();
|
||||
|
||||
|
@ -1085,12 +1080,7 @@ Value ServicesTable::CustomVariableValuesAccessor(const Value& row)
|
|||
if (!service)
|
||||
return Empty;
|
||||
|
||||
Dictionary::Ptr vars;
|
||||
|
||||
{
|
||||
ObjectLock olock(service);
|
||||
vars = service->GetVars();
|
||||
}
|
||||
Dictionary::Ptr vars = service->GetVars();
|
||||
|
||||
Array::Ptr cv = new Array();
|
||||
|
||||
|
@ -1115,12 +1105,7 @@ Value ServicesTable::CustomVariablesAccessor(const Value& row)
|
|||
if (!service)
|
||||
return Empty;
|
||||
|
||||
Dictionary::Ptr vars;
|
||||
|
||||
{
|
||||
ObjectLock olock(service);
|
||||
vars = service->GetVars();
|
||||
}
|
||||
Dictionary::Ptr vars = service->GetVars();
|
||||
|
||||
Array::Ptr cv = new Array();
|
||||
|
||||
|
@ -1150,12 +1135,7 @@ Value ServicesTable::CVIsJsonAccessor(const Value& row)
|
|||
if (!service)
|
||||
return Empty;
|
||||
|
||||
Dictionary::Ptr vars;
|
||||
|
||||
{
|
||||
ObjectLock olock(service);
|
||||
vars = service->GetVars();
|
||||
}
|
||||
Dictionary::Ptr vars = service->GetVars();
|
||||
|
||||
if (!vars)
|
||||
return Empty;
|
||||
|
|
Loading…
Reference in New Issue