1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-11-14 00:06:15 +01:00

add meaningful error if no attribute name

This commit is contained in:
lethliel 2017-12-08 13:20:24 +01:00
parent b1d6d8347b
commit 43be8f0e9c

View File

@ -288,6 +288,8 @@ class Serviceinfo:
for service in services: for service in services:
name = service.get('name') name = service.get('name')
if name is None:
error("invalid service definition. Attribute name missing.", service)
if len(name) < 3 or '/' in name: if len(name) < 3 or '/' in name:
error("invalid service name: %s" % name, service) error("invalid service name: %s" % name, service)
mode = service.get('mode', '') mode = service.get('mode', '')