Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config/toggle validation #164

Merged
merged 2 commits into from
Aug 6, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions tardis/io/config_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,7 @@ def from_yaml(cls, fname, test_parser=False):

@classmethod
def from_config_dict(cls, config_dict, atom_data=None, test_parser=False,
config_definition_file=None):
config_definition_file=None, validate=True):
"""
Validating and subsequently parsing a config file.

Expand All @@ -759,6 +759,9 @@ def from_config_dict(cls, config_dict, atom_data=None, test_parser=False,
path to config definition file, if `None` will be set to the default
in the `data` directory that ships with TARDIS

validate: ~bool
Turn validation on or off.


Returns
-------
Expand All @@ -771,9 +774,11 @@ def from_config_dict(cls, config_dict, atom_data=None, test_parser=False,
config_definition_file = default_config_definition_file

config_definition = yaml.load(open(config_definition_file))

validated_config_dict = ConfigurationValidator(config_definition,
if validate:
validated_config_dict = ConfigurationValidator(config_definition,
config_dict).get_config()
else:
validated_config_dict = config_dict

#First let's see if we can find an atom_db anywhere:
if test_parser:
Expand Down