Merge "Fail if specified set of defaults is not found."

This commit is contained in:
Jenkins 2014-05-28 01:49:57 +00:00 committed by Gerrit Code Review
commit 24ce90ea84
1 changed files with 3 additions and 0 deletions

View File

@ -170,6 +170,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)