Skip to content

Commit

Permalink
add meaningful error if no attribute name
Browse files Browse the repository at this point in the history
  • Loading branch information
lethliel committed Dec 8, 2017
1 parent b1d6d83 commit 43be8f0
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 43be8f0

Please sign in to comment.