From e7953366112bbfb0b868c0aaf4a7c755be411b99 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Fri, 3 Aug 2012 15:35:50 +0200 Subject: [PATCH] Fixed incorrect object type. --- components/convenience/conveniencecomponent.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/components/convenience/conveniencecomponent.cpp b/components/convenience/conveniencecomponent.cpp index 50d55ac4b..f8bf2aaa6 100644 --- a/components/convenience/conveniencecomponent.cpp +++ b/components/convenience/conveniencecomponent.cpp @@ -70,15 +70,15 @@ static void CopyServiceAttributes(const Host::Ptr& host, TDict serviceDesc, void ConvenienceComponent::HostCommittedHandler(const ConfigItem::Ptr& item) { - if (item->GetType() != "host") + if (item->GetType() != "Host") return; - Host::Ptr host = Host::GetByName(item->GetName()); - /* ignore abstract host objects */ - if (!host) + if (!Host::Exists(item->GetName())) return; + Host::Ptr host = Host::GetByName(item->GetName()); + Dictionary::Ptr oldServices = host->Get("convenience_services"); Dictionary::Ptr newServices; @@ -95,7 +95,7 @@ void ConvenienceComponent::HostCommittedHandler(const ConfigItem::Ptr& item) String name = namebuf.str(); ConfigItemBuilder::Ptr builder = boost::make_shared(item->GetDebugInfo()); - builder->SetType("service"); + builder->SetType("Service"); builder->SetName(name); builder->AddExpression("host_name", OperatorSet, item->GetName()); builder->AddExpression("alias", OperatorSet, svcname); @@ -141,7 +141,7 @@ void ConvenienceComponent::HostCommittedHandler(const ConfigItem::Ptr& item) void ConvenienceComponent::HostRemovedHandler(const ConfigItem::Ptr& item) { - if (item->GetType() != "host") + if (item->GetType() != "Host") return; DynamicObject::Ptr host = item->GetDynamicObject(); -- 2.40.0