mirror of https://github.com/Icinga/icinga2.git
Fixed incorrect object type.
This commit is contained in:
parent
bb7e1e639d
commit
e795336611
|
@ -70,15 +70,15 @@ static void CopyServiceAttributes(const Host::Ptr& host, TDict serviceDesc,
|
||||||
|
|
||||||
void ConvenienceComponent::HostCommittedHandler(const ConfigItem::Ptr& item)
|
void ConvenienceComponent::HostCommittedHandler(const ConfigItem::Ptr& item)
|
||||||
{
|
{
|
||||||
if (item->GetType() != "host")
|
if (item->GetType() != "Host")
|
||||||
|
return;
|
||||||
|
|
||||||
|
/* ignore abstract host objects */
|
||||||
|
if (!Host::Exists(item->GetName()))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Host::Ptr host = Host::GetByName(item->GetName());
|
Host::Ptr host = Host::GetByName(item->GetName());
|
||||||
|
|
||||||
/* ignore abstract host objects */
|
|
||||||
if (!host)
|
|
||||||
return;
|
|
||||||
|
|
||||||
Dictionary::Ptr oldServices = host->Get("convenience_services");
|
Dictionary::Ptr oldServices = host->Get("convenience_services");
|
||||||
|
|
||||||
Dictionary::Ptr newServices;
|
Dictionary::Ptr newServices;
|
||||||
|
@ -95,7 +95,7 @@ void ConvenienceComponent::HostCommittedHandler(const ConfigItem::Ptr& item)
|
||||||
String name = namebuf.str();
|
String name = namebuf.str();
|
||||||
|
|
||||||
ConfigItemBuilder::Ptr builder = boost::make_shared<ConfigItemBuilder>(item->GetDebugInfo());
|
ConfigItemBuilder::Ptr builder = boost::make_shared<ConfigItemBuilder>(item->GetDebugInfo());
|
||||||
builder->SetType("service");
|
builder->SetType("Service");
|
||||||
builder->SetName(name);
|
builder->SetName(name);
|
||||||
builder->AddExpression("host_name", OperatorSet, item->GetName());
|
builder->AddExpression("host_name", OperatorSet, item->GetName());
|
||||||
builder->AddExpression("alias", OperatorSet, svcname);
|
builder->AddExpression("alias", OperatorSet, svcname);
|
||||||
|
@ -141,7 +141,7 @@ void ConvenienceComponent::HostCommittedHandler(const ConfigItem::Ptr& item)
|
||||||
|
|
||||||
void ConvenienceComponent::HostRemovedHandler(const ConfigItem::Ptr& item)
|
void ConvenienceComponent::HostRemovedHandler(const ConfigItem::Ptr& item)
|
||||||
{
|
{
|
||||||
if (item->GetType() != "host")
|
if (item->GetType() != "Host")
|
||||||
return;
|
return;
|
||||||
|
|
||||||
DynamicObject::Ptr host = item->GetDynamicObject();
|
DynamicObject::Ptr host = item->GetDynamicObject();
|
||||||
|
|
Loading…
Reference in New Issue