Skip to content

Commit

Permalink
Merge branch 'error_on_invalid_xml' of https://github.com/lethliel/osc
Browse files Browse the repository at this point in the history
Improve error handling in Serviceinfo.read.

Fixes: #360 ("improve error message if service xml is missing name
attribute")
  • Loading branch information
marcus-h committed Dec 8, 2017
2 parents b1d6d83 + 43be8f0 commit d79eb25
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions osc/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,8 @@ def error(msg, xml):

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', '')
Expand Down

0 comments on commit d79eb25

Please sign in to comment.