Merge "Fail if specified set of defaults is not found."
This commit is contained in:
commit
24ce90ea84
@ -170,6 +170,9 @@ class YamlParser(object):
|
|||||||
def applyDefaults(self, data):
|
def applyDefaults(self, data):
|
||||||
whichdefaults = data.get('defaults', 'global')
|
whichdefaults = data.get('defaults', 'global')
|
||||||
defaults = self.data.get('defaults', {}).get(whichdefaults, {})
|
defaults = self.data.get('defaults', {}).get(whichdefaults, {})
|
||||||
|
if defaults == {} and whichdefaults != 'global':
|
||||||
|
raise JenkinsJobsException("Unknown defaults set: '{0}'"
|
||||||
|
.format(whichdefaults))
|
||||||
newdata = {}
|
newdata = {}
|
||||||
newdata.update(defaults)
|
newdata.update(defaults)
|
||||||
newdata.update(data)
|
newdata.update(data)
|
||||||
|
Loading…
Reference in New Issue
Block a user