mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-29 16:54:06 +02:00
Sync: indentation
This commit is contained in:
parent
fc5976b5f8
commit
62a0f5f9c2
@ -194,40 +194,42 @@ class Sync
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$dba = $db->getDbAdapter();
|
$dba = $db->getDbAdapter();
|
||||||
$dba->beginTransaction();
|
$dba->beginTransaction();
|
||||||
foreach ($objects as $object) {
|
foreach ($objects as $object) {
|
||||||
if ($object instanceof IcingaObject && $object->isTemplate()) {
|
if ($object instanceof IcingaObject && $object->isTemplate()) {
|
||||||
if ($object->hasBeenModified()) {
|
if ($object->hasBeenModified()) {
|
||||||
throw new IcingaException(
|
throw new IcingaException(
|
||||||
'Sync is not allowed to modify template "%s"',
|
'Sync is not allowed to modify template "%s"',
|
||||||
$object->$objectKey
|
$object->$objectKey
|
||||||
);
|
);
|
||||||
}
|
|
||||||
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($object->hasBeenLoadedFromDb() && $rule->purge_existing === 'y') {
|
continue;
|
||||||
$found = false;
|
|
||||||
foreach ($sources as $source) {
|
|
||||||
if (array_key_exists($object->$objectKey, $imported[$source->id])) {
|
|
||||||
$found = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (! $found) {
|
|
||||||
$object->delete();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (! $object->$objectKey) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
$object->store($db);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$dba->commit();
|
if ($object->hasBeenLoadedFromDb() && $rule->purge_existing === 'y') {
|
||||||
|
$found = false;
|
||||||
|
foreach ($sources as $source) {
|
||||||
|
if (array_key_exists($object->$objectKey, $imported[$source->id])) {
|
||||||
|
$found = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! $found) {
|
||||||
|
$object->delete();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: This should be noticed or removed:
|
||||||
|
if (! $object->$objectKey) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$object->store($db);
|
||||||
|
}
|
||||||
|
|
||||||
|
$dba->commit();
|
||||||
return 42; // We have no sync_run history table yet
|
return 42; // We have no sync_run history table yet
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user