Fail if specified set of defaults is not found.

Change-Id: I1c764d5585249b28bd25f775abee2734e96b1640
This commit is contained in:
Joao Vale 2014-04-25 11:33:39 +01:00
parent a9fb1bec14
commit 93a9ddcff9

View File

@ -169,6 +169,9 @@ class YamlParser(object):
def applyDefaults(self, data):
whichdefaults = data.get('defaults', 'global')
defaults = self.data.get('defaults', {}).get(whichdefaults, {})
if defaults == {} and whichdefaults != 'global':
raise JenkinsJobsException("Unknown defaults set: '{0}'"
.format(whichdefaults))
newdata = {}
newdata.update(defaults)
newdata.update(data)