Browse Source

Account for case-insensitive env on windows platform

Signed-off-by: Joffrey F <[email protected]>
Joffrey F 9 năm trước cách đây
mục cha
commit
c7afe16419
1 tập tin đã thay đổi với 6 bổ sung0 xóa
  1. 6 0
      compose/config/environment.py

+ 6 - 0
compose/config/environment.py

@@ -7,6 +7,7 @@ import os
 
 import six
 
+from ..const import IS_WINDOWS_PLATFORM
 from .errors import ConfigurationError
 
 log = logging.getLogger(__name__)
@@ -58,6 +59,11 @@ class Environment(dict):
         try:
             return super(Environment, self).__getitem__(key)
         except KeyError:
+            if IS_WINDOWS_PLATFORM:
+                try:
+                    return super(Environment, self).__getitem__(key.upper())
+                except KeyError:
+                    pass
             if key not in self.missing_keys:
                 log.warn(
                     "The {} variable is not set. Defaulting to a blank string."