Skip to content

Commit

Permalink
StatusDataWriter: Fix dependency relations.
Browse files Browse the repository at this point in the history
Fixes #6131
  • Loading branch information
Michael Friedrich committed May 6, 2014
1 parent 19b7f79 commit cfa382f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion components/compat/statusdatawriter.cpp
Expand Up @@ -731,6 +731,7 @@ void StatusDataWriter::UpdateObjectsCache(void)

String criteria = boost::algorithm::join(failure_criteria, ",");

/* Icinga 1.x only allows host->host, service->service dependencies */
if (!child_service && !parent_service) {
objectfp << "define hostdependency {" "\n"
"\t" "dependent_host_name" "\t" << child_host->GetName() << "\n"
Expand All @@ -739,7 +740,7 @@ void StatusDataWriter::UpdateObjectsCache(void)
"\t" "notification_failure_criteria" "\t" << criteria << "\n"
"\t" "}" "\n"
"\n";
} else {
} else if (child_service && parent_service){

objectfp << "define servicedependency {" "\n"
"\t" "dependent_host_name" "\t" << child_service->GetHost()->GetName() << "\n"
Expand Down

0 comments on commit cfa382f

Please sign in to comment.