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

Merge branch 'error_on_invalid_xml' of https://github.com/lethliel/osc

Improve error handling in Serviceinfo.read.

Fixes: #360 ("improve error message if service xml is missing name
attribute")
This commit is contained in:
Marcus Huewe 2017-12-08 13:43:19 +01:00
commit d79eb2580b

View File

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