IcingaObject: do not fail when rendering objects...
...without imports support fixes #12618
This commit is contained in:
parent
1a2cede13f
commit
c1afda4392
|
@ -1412,6 +1412,14 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
|
|||
return $this->zone;
|
||||
}
|
||||
|
||||
if ($this->hasProperty('zone_id')) {
|
||||
if (! $this->supportsImports()) {
|
||||
if ($zoneId = $this->zone_id) {
|
||||
// Config has a lookup cache, is faster:
|
||||
return $config->getZoneName($zoneId);
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
if ($zoneId = $this->getResolvedProperty('zone_id')) {
|
||||
// Config has a lookup cache, is faster:
|
||||
|
@ -1420,6 +1428,7 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
|
|||
} catch (Exception $e) {
|
||||
return self::RESOLVE_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->prefersGlobalZone()) {
|
||||
return $this->connection->getDefaultGlobalZoneName();
|
||||
|
|
Loading…
Reference in New Issue