def _prepare_stages_config(self, stages_config):
stages_defaults = {}
for key in self.STAGE_KEYWORDS:
stages_defaults[key] = stages_config.pop(key, {})
for stage in stages_config:
for key in self.STAGE_KEYWORDS:
stages_config[stage][key] = merge_dicts(
stages_config[stage].get(key, {}).copy(),
After Change
for key in self.STAGE_KEYWORDS:
stages_defaults[key] = stages_config_in.get(key, {}).copy()
for stage in stages_config_in:
if stage in self.STAGE_KEYWORDS:
continue
stages_config_out[stage] = {}
for key in self.STAGE_KEYWORDS:
stages_config_out[stage][key] = merge_dicts(
stages_config_in[stage].get(key, {}).copy(),
stages_defaults.get(key, {}).copy()