Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fill gear defaults on a copy
Browse files Browse the repository at this point in the history
ambrussimon committed Nov 7, 2017
1 parent e126ebf commit 0381acf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion api/jobs/gears.py
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@
from __future__ import absolute_import

import bson.objectid
import copy
import datetime
from jsonschema import Draft4Validator, ValidationError
import gears as gear_tools
@@ -131,8 +132,10 @@ def fill_gear_default_values(gear, config_):

if config_ is None:
config_ = {}
else:
config_ = copy.deepcopy(config_)

for k,v in gear['gear'].get('config', {}).iteritems():
for k, v in gear['gear'].get('config', {}).iteritems():
if 'default' in v:
config_.setdefault(k, v['default'])

0 comments on commit 0381acf

Please sign in to comment.