IcingaObject: fix arguments rendering for external

...objects
This commit is contained in:
Thomas Gelf 2016-10-25 02:28:19 +00:00
parent 47cd8cdc89
commit fa2c360f4c
1 changed files with 6 additions and 1 deletions

View File

@ -1378,8 +1378,10 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
$config = new IcingaConfig($this->connection); $config = new IcingaConfig($this->connection);
$object = $this; $object = $this;
if ($object->isExternal()) { if ($object->isExternal()) {
$object = clone($object);
$object->object_type = 'object'; $object->object_type = 'object';
$wasExternal = true;
} else {
$wasExternal = false;
} }
try { try {
@ -1392,6 +1394,9 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
. '/* ' . $e->getMessage() . ' */' . '/* ' . $e->getMessage() . ' */'
); );
} }
if ($wasExternal) {
$object->object_type = 'external_object';
}
return $config; return $config;
} }