Merge "Toplevel collection typecheck."
This commit is contained in:
commit
ca01c62187
@ -120,6 +120,10 @@ class YamlParser(object):
|
|||||||
def parse(self, fn):
|
def parse(self, fn):
|
||||||
data = yaml.load(open(fn))
|
data = yaml.load(open(fn))
|
||||||
if data:
|
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:
|
for item in data:
|
||||||
cls, dfn = item.items()[0]
|
cls, dfn = item.items()[0]
|
||||||
group = self.data.get(cls, {})
|
group = self.data.get(cls, {})
|
||||||
|
Loading…
Reference in New Issue
Block a user