diff options
author | Aanand Prasad <aanand.prasad@gmail.com> | 2016-08-01 13:51:58 +0100 |
---|---|---|
committer | Aanand Prasad <aanand.prasad@gmail.com> | 2016-08-01 14:52:39 +0100 |
commit | f006da6a43e39a1126ccca1651e9ff4abda41aaa (patch) | |
tree | 34ff4a96b30769926178928970263209592181da | |
parent | 8a6b1843c33a5956a09c04a68305be9b116b0b6a (diff) | |
download | docker-py-f006da6a43e39a1126ccca1651e9ff4abda41aaa.tar.gz |
More explicit debug for config path logic
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
-rw-r--r-- | docker/auth/auth.py | 13 |
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: |