From 591afd441e4308f1b97871e42565c1de26accf5e Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Mon, 8 Oct 2018 09:14:15 +0200 Subject: [PATCH] BasketSnapshot: be explicit, make special Service ...treatment obvious --- .../DirectorObject/Automation/BasketSnapshot.php | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/library/Director/DirectorObject/Automation/BasketSnapshot.php b/library/Director/DirectorObject/Automation/BasketSnapshot.php index 36d3ed40..4e5b2714 100644 --- a/library/Director/DirectorObject/Automation/BasketSnapshot.php +++ b/library/Director/DirectorObject/Automation/BasketSnapshot.php @@ -231,14 +231,6 @@ class BasketSnapshot extends DbObject } } - protected static function classWantsTemplate($class) - { - return strpos($class, '\\Icinga\\Module\\Director\\Objects\\Icinga') === 0 - && strpos($class, 'Choice') === false - && strpos($class, 'Group') === false - && strpos($class, 'Command') === false; - } - protected function addAll($typeName) { $class = static::getClassForType($typeName); @@ -279,9 +271,7 @@ class BasketSnapshot extends DbObject public static function instanceByIdentifier($typeName, $identifier, Db $connection) { $class = static::getClassForType($typeName); - if (static::classWantsTemplate($class) - && strpos($class, 'IcingaHost') === false - ) { + if (substr($class, -13) === 'IcingaService') { $identifier = [ 'object_type' => 'template', 'object_name' => $identifier,