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