prevent startup when layout.yaml has invalid syntax
Bug #1057471 reported by
Antoine "hashar" Musso
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zuul |
Triaged
|
Medium
|
Unassigned |
Bug Description
My layout.yaml had an invalid block making zuul (dev branch) choke with:
ParserError: while parsing a block collection
in "/etc/zuul/
expected <block end>, but found '?'
in "/etc/zuul/
2012-09-27 11:11:04,151 DEBUG zuul.Scheduler: Run handler sleeping
I guess zuul should catch the ParserError exception and abort early.
To post a comment you must log in.
Similar issue, layout.yaml had no 'jobs' section despite it being marked as optional in the documentation.
Stack trace from zuul dev branch:
2012-09-27 11:17:22,859 ERROR zuul.Scheduler: Exception in run handler: lib/python2. 7/dist- packages/ zuul-1. 0-py2.7. egg/zuul/ scheduler. py", line 330, in run _doPauseEvent( ) lib/python2. 7/dist- packages/ zuul-1. 0-py2.7. egg/zuul/ scheduler. py", line 294, in _doPauseEvent _parseConfig( self.config. get('zuul' , 'layout_config')) lib/python2. 7/dist- packages/ zuul-1. 0-py2.7. egg/zuul/ scheduler. py", line 105, in _parseConfig
Traceback (most recent call last):
File "/usr/local/
self.
File "/usr/local/
self.
File "/usr/local/
for config_job in data['jobs']:
TypeError: 'NoneType' object is not iterable
Same happens when key was named 'project' instead of 'projects' (aka singular vs plural form).
At startup zuul should probably run scheduler. _parseConfig( ) and abort whenever an exception is raised.