summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoffrey F <f.joffrey@gmail.com>2016-08-01 10:59:32 -0700
committerGitHub <noreply@github.com>2016-08-01 10:59:32 -0700
commitf99dc45d827b0ab3c4fb6faeb46e99d58977c572 (patch)
tree34ff4a96b30769926178928970263209592181da
parent8a6b1843c33a5956a09c04a68305be9b116b0b6a (diff)
parentf006da6a43e39a1126ccca1651e9ff4abda41aaa (diff)
downloaddocker-py-f99dc45d827b0ab3c4fb6faeb46e99d58977c572.tar.gz
Merge pull request #1146 from aanand/config-path-debug
More explicit debug for config path logic
-rw-r--r--docker/auth/auth.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/docker/auth/auth.py b/docker/auth/auth.py
index d23e6f3..b61a8d0 100644
--- a/docker/auth/auth.py
+++ b/docker/auth/auth.py
@@ -160,18 +160,24 @@ def find_config_file(config_path=None):
os.path.basename(DOCKER_CONFIG_FILENAME)
) if os.environ.get('DOCKER_CONFIG') else None
- paths = [
+ paths = filter(None, [
config_path, # 1
environment_path, # 2
os.path.join(os.path.expanduser('~'), DOCKER_CONFIG_FILENAME), # 3
os.path.join(
os.path.expanduser('~'), LEGACY_DOCKER_CONFIG_FILENAME
) # 4
- ]
+ ])
+
+ log.debug("Trying paths: {0}".format(repr(paths)))
for path in paths:
- if path and os.path.exists(path):
+ if os.path.exists(path):
+ log.debug("Found file at path: {0}".format(path))
return path
+
+ log.debug("No config file found")
+
return None
@@ -186,7 +192,6 @@ def load_config(config_path=None):
config_file = find_config_file(config_path)
if not config_file:
- log.debug("File doesn't exist")
return {}
try: