mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-09-26 03:09:11 +02:00
parent
b051b2da17
commit
39538a3f33
@ -272,6 +272,29 @@ class SyncRule extends DbObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($hasHost !== false && $hasObjectName !== false) {
|
||||||
|
$this->hasCombinedKey = true;
|
||||||
|
$this->sourceKeyPattern = sprintf(
|
||||||
|
'%s!%s',
|
||||||
|
$hasHost,
|
||||||
|
$hasObjectName
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->destinationKeyPattern = '${host}!${object_name}';
|
||||||
|
}
|
||||||
|
} elseif ($this->get('object_type') === 'serviceSet') {
|
||||||
|
$hasHost = false;
|
||||||
|
$hasObjectName = false;
|
||||||
|
|
||||||
|
foreach ($this->getSyncProperties() as $key => $property) {
|
||||||
|
if ($property->destination_field === 'host') {
|
||||||
|
$hasHost = $property->source_expression;
|
||||||
|
}
|
||||||
|
if ($property->destination_field === 'object_name') {
|
||||||
|
$hasObjectName = $property->source_expression;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($hasHost !== false && $hasObjectName !== false) {
|
if ($hasHost !== false && $hasObjectName !== false) {
|
||||||
$this->hasCombinedKey = true;
|
$this->hasCombinedKey = true;
|
||||||
$this->sourceKeyPattern = sprintf(
|
$this->sourceKeyPattern = sprintf(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user