Skip to content

Commit

Permalink
WIP: Better handle loading of configuration parameter types
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastientourbier committed Feb 26, 2021
1 parent 9bd70a5 commit f5b394e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmtklib/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,8 @@ def set_pipeline_attributes_from_config(pipeline, config, debug=True):
conf_value = bool(conf_value)
elif isinstance(getattr(sub_config, sub_key), list):
conf_value = eval(conf_value)
elif isinstance(getattr(sub_config, sub_key), dict):
conf_value = eval(conf_value)
elif isinstance(getattr(sub_config, sub_key), int):
conf_value = int(conf_value)
if debug:
Expand Down Expand Up @@ -443,6 +445,8 @@ def set_pipeline_attributes_from_config(pipeline, config, debug=True):
conf_value = bool(conf_value)
elif isinstance(getattr(stage.config, key), list):
conf_value = eval(conf_value)
elif isinstance(getattr(stage.config, key), dict):
conf_value = eval(conf_value)
elif isinstance(getattr(stage.config, key), int):
conf_value = int(conf_value)
if debug:
Expand Down

0 comments on commit f5b394e

Please sign in to comment.