From 7629e8fc8f5e450a14683f22b72ba9220f187b19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Kundr=C3=A1t?= Date: Fri, 24 Oct 2014 01:05:02 +0200 Subject: 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 --- zuul/layoutvalidator.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/zuul/layoutvalidator.py b/zuul/layoutvalidator.py index 9a4e00f5d..4f3ff00b7 100644 --- a/zuul/layoutvalidator.py +++ b/zuul/layoutvalidator.py @@ -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 = [] -- cgit v1.2.1