IcingaHost: explicitly delete related Service/Sets

fixes #623
This commit is contained in:
Thomas Gelf 2019-09-20 00:59:17 +02:00
parent 75b78c5ddb
commit 42ea7a5a05
1 changed files with 12 additions and 0 deletions

View File

@ -347,6 +347,18 @@ class IcingaHost extends IcingaObject implements ExportInterface
}
}
public function beforeDelete()
{
foreach ($this->fetchServices() as $service) {
$service->delete();
}
foreach ($this->fetchServiceSets() as $set) {
$set->delete();
}
parent::beforeDelete();
}
public function hasAnyOverridenServiceVars()
{
$varname = $this->getServiceOverrivesVarname();