mirror of
https://github.com/systemd/systemd
synced 2024-09-06 16:56:43 +00:00
Merge pull request #2915 from lnykryn/template
core: improve error message when starting template without instance
This commit is contained in:
commit
f5924cab7f
|
@ -1333,8 +1333,12 @@ int manager_load_unit_prepare(
|
|||
|
||||
t = unit_name_to_type(name);
|
||||
|
||||
if (t == _UNIT_TYPE_INVALID || !unit_name_is_valid(name, UNIT_NAME_PLAIN|UNIT_NAME_INSTANCE))
|
||||
if (t == _UNIT_TYPE_INVALID || !unit_name_is_valid(name, UNIT_NAME_PLAIN|UNIT_NAME_INSTANCE)) {
|
||||
if (unit_name_is_valid(name, UNIT_NAME_TEMPLATE))
|
||||
return sd_bus_error_setf(e, SD_BUS_ERROR_INVALID_ARGS, "Unit name %s is missing the instance name.", name);
|
||||
|
||||
return sd_bus_error_setf(e, SD_BUS_ERROR_INVALID_ARGS, "Unit name %s is not valid.", name);
|
||||
}
|
||||
|
||||
ret = manager_get_unit(m, name);
|
||||
if (ret) {
|
||||
|
|
Loading…
Reference in a new issue