Validate top level of the layout configuration, too

I got an exception that a list object has no method "get" when I
accidentally put the contents of my pipelines as the top level object in
the layout YAML file.

Change-Id: Ia88f2a849bbc1dca5ec44afc969ddfa9c3598f1e
This commit is contained in:
Jan Kundrát
2014-10-24 01:05:02 +02:00
parent 1f4f8e136e
commit 7629e8fc8f

View File

@@ -192,6 +192,9 @@ class LayoutSchema(object):
return parameters
def getSchema(self, data):
if not isinstance(data, dict):
raise Exception("Malformed layout configuration: top-level type "
"should be a dictionary")
pipelines = data.get('pipelines')
if not pipelines:
pipelines = []