Merge "Toplevel collection typecheck."

This commit is contained in:
Jenkins 2014-02-20 00:45:15 +00:00 committed by Gerrit Code Review
commit ca01c62187
1 changed files with 4 additions and 0 deletions

View File

@ -120,6 +120,10 @@ class YamlParser(object):
def parse(self, fn):
data = yaml.load(open(fn))
if data:
if not isinstance(data, list):
raise JenkinsJobsException(
"The topmost collection in file '{fname}' must be a list,"
" not a {cls}".format(fname=fn, cls=type(data)))
for item in data:
cls, dfn = item.items()[0]
group = self.data.get(cls, {})