Quellcode durchsuchen

Switch order of connection logic so TCP is tried first

Ben Firshman vor 12 Jahren
Ursprung
Commit
d4000e07a9
1 geänderte Dateien mit 3 neuen und 3 gelöschten Zeilen
  1. 3 3
      fig/cli/utils.py

+ 3 - 3
fig/cli/utils.py

@@ -93,9 +93,6 @@ def docker_url():
     tcp_host = '127.0.0.1'
     tcp_host = '127.0.0.1'
     tcp_port = 4243
     tcp_port = 4243
 
 
-    if os.path.exists(socket_path):
-        return 'unix://%s' % socket_path
-
     for host, port in tcp_hosts:
     for host, port in tcp_hosts:
         try:
         try:
             s = socket.create_connection((host, port), timeout=1)
             s = socket.create_connection((host, port), timeout=1)
@@ -104,6 +101,9 @@ def docker_url():
         except:
         except:
             pass
             pass
 
 
+    if os.path.exists(socket_path):
+        return 'unix://%s' % socket_path
+
     raise UserError("""
     raise UserError("""
 Couldn't find Docker daemon - tried:
 Couldn't find Docker daemon - tried: