Browse Source

Adds additional validation to 'env_vars_from_file'.

The 'env_file' directive and feature precludes the use of the name
'.env' in the path shared with 'docker-config.yml', regardless of
whether or not it is enabled.

This change adds an additional validation to allow the use of this
path provided it is not a file.

Signed-off-by: Thom Linton <[email protected]>
Thom Linton 10 years ago
parent
commit
28fb91b344
1 changed files with 2 additions and 0 deletions
  1. 2 0
      compose/config/environment.py

+ 2 - 0
compose/config/environment.py

@@ -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()