mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-29 16:54:06 +02:00
ObjectImporter, BasketDiff: fallback for baskets...
...with UUID, and no matching entry. Will adjust UUIDs for matching objects
This commit is contained in:
parent
5a732170af
commit
045f4ec941
@ -120,8 +120,10 @@ class ObjectImporter
|
|||||||
*/
|
*/
|
||||||
protected function loadExistingObject(string $implementation, stdClass $plain): ?DbObject
|
protected function loadExistingObject(string $implementation, stdClass $plain): ?DbObject
|
||||||
{
|
{
|
||||||
if (isset($plain->uuid)) {
|
if (isset($plain->uuid)
|
||||||
return $implementation::loadWithUniqueId(Uuid::fromString($plain->uuid), $this->db);
|
&& $instance = $implementation::loadWithUniqueId(Uuid::fromString($plain->uuid), $this->db)
|
||||||
|
) {
|
||||||
|
return $instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($implementation === IcingaService::class) {
|
if ($implementation === IcingaService::class) {
|
||||||
|
@ -97,8 +97,8 @@ class BasketDiff
|
|||||||
|
|
||||||
public function getCurrentInstance(string $type, string $key, ?UuidInterface $uuid = null)
|
public function getCurrentInstance(string $type, string $key, ?UuidInterface $uuid = null)
|
||||||
{
|
{
|
||||||
if ($uuid) {
|
if ($uuid && $instance = BasketSnapshot::instanceByUuid($type, $uuid, $this->db)) {
|
||||||
return BasketSnapshot::instanceByUuid($type, $uuid, $this->db);
|
return $instance;
|
||||||
} else {
|
} else {
|
||||||
return BasketSnapshot::instanceByIdentifier($type, $key, $this->db);
|
return BasketSnapshot::instanceByIdentifier($type, $key, $this->db);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user