Created
February 20, 2020 09:34
-
-
Save lazyfrosch/cc5c3bc29922e530139235bbd031aceb to your computer and use it in GitHub Desktop.
Icinga Director Hack to allow ServiceSet Import of templates (the service sets themselve)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/library/Director/Objects/ImportSource.php b/library/Director/Objects/ImportSource.php | |
index a58aa195..e9b115c5 100644 | |
--- a/library/Director/Objects/ImportSource.php | |
+++ b/library/Director/Objects/ImportSource.php | |
@@ -119,7 +119,7 @@ class ImportSource extends DbObjectWithSettings implements ExportInterface | |
$this->loadedRowModifiers = $this->fetchRowModifiers(); | |
} | |
$current = $this->loadedRowModifiers; | |
- if ($current !== null && count($current) !== count($modifiers)) { | |
+ if (empty($current) || count($current) !== count($modifiers)) { | |
$this->newRowModifiers = $modifiers; | |
} else { | |
$i = 0; | |
diff --git a/library/Director/Objects/SyncRule.php b/library/Director/Objects/SyncRule.php | |
index cb04b179..ee6a9785 100644 | |
--- a/library/Director/Objects/SyncRule.php | |
+++ b/library/Director/Objects/SyncRule.php | |
@@ -449,6 +449,13 @@ class SyncRule extends DbObject implements ExportInterface | |
); | |
$this->destinationKeyPattern = '${host}!${object_name}'; | |
+ } else { | |
+ $this->hasCombinedKey = true; | |
+ $this->sourceKeyPattern = sprintf( | |
+ '!%s', | |
+ $hasObjectName | |
+ ); | |
+ $this->destinationKeyPattern = '!${object_name}'; | |
} | |
} elseif ($this->get('object_type') === 'datalistEntry') { | |
$hasList = false; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This won't allow purging!