From 0381acf2e3146ec9868a09556731636949c6a898 Mon Sep 17 00:00:00 2001 From: Ambrus Simon Date: Tue, 7 Nov 2017 14:59:03 +0100 Subject: [PATCH] Fill gear defaults on a copy --- api/jobs/gears.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api/jobs/gears.py b/api/jobs/gears.py index 51da45584..82fa4711e 100644 --- a/api/jobs/gears.py +++ b/api/jobs/gears.py @@ -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'])