Skip to content

Commit

Permalink
Merge pull request docker#3399 from yorkedork/fix/env-file-validation
Browse files Browse the repository at this point in the history
Adds additional validation to 'env_vars_from_file'.
  • Loading branch information
shin- committed May 12, 2016
2 parents f1603a3 + 28fb91b commit dc88e54
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions compose/config/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ def env_vars_from_file(filename):
"""
if not os.path.exists(filename):
raise ConfigurationError("Couldn't find env file: %s" % filename)
elif not os.path.isfile(filename):
raise ConfigurationError("%s is not a file." % (filename))
env = {}
for line in codecs.open(filename, 'r', 'utf-8'):
line = line.strip()
Expand Down

0 comments on commit dc88e54

Please sign in to comment.