Skip to content

Commit

Permalink
Update Panoptes Validators in parse_config_file
Browse files Browse the repository at this point in the history
  • Loading branch information
road-cycling committed Oct 17, 2019
1 parent f701d97 commit 9aa29a1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions yahoo_panoptes/framework/utilities/helpers.py
Expand Up @@ -26,6 +26,7 @@
from io import StringIO

from yahoo_panoptes.framework.exceptions import PanoptesBaseException
from yahoo_panoptes.framework.validators import PanoptesValidators
from configobj import ConfigObj, ConfigObjError, flatten_errors
from validate import Validator

Expand Down Expand Up @@ -245,8 +246,9 @@ class PanoptesConfigurationParsingError(PanoptesBaseException):


def parse_config_file(config_file, config_spec_file):
assert config_file and isinstance(config_file, str), 'config_file must be a non-empty str'
assert config_spec_file and isinstance(config_spec_file, str), 'config_spec_file must be a non empty str'
assert PanoptesValidators.valid_nonempty_string(config_file), 'config_file must be a non-empty str'
assert PanoptesValidators.valid_nonempty_string(config_spec_file), \
'config_spec_file must be a non empty str'

try:
config = ConfigObj(config_file, configspec=config_spec_file, interpolation='template', file_error=True)
Expand Down

0 comments on commit 9aa29a1

Please sign in to comment.