ObjectCommand: show created object name...

...even if given via JSON only

fixes #2576
This commit is contained in:
Thomas Gelf 2022-08-02 11:59:21 +02:00
parent 05362a093d
commit 5409558d3b
1 changed files with 5 additions and 4 deletions

View File

@ -141,11 +141,12 @@ class ObjectCommand extends Command
} else { } else {
$props['object_name'] = $name; $props['object_name'] = $name;
} }
} } else {
if (! array_key_exists('object_name', $props)) { if (! array_key_exists('object_name', $props)) {
$this->fail('Cannot create an object with at least an object name'); $this->fail('Cannot create an object with at least an object name');
} }
$name = $props['object_name'];
}
$object = IcingaObject::createByType( $object = IcingaObject::createByType(
$type, $type,