From dc82f0c819e436cd2ecd63ff95390d3e47205818 Mon Sep 17 00:00:00 2001 From: Russ Bubley Date: Tue, 2 Jul 2019 17:59:01 +0100 Subject: [PATCH 1/4] Respect security configuration (#2815) --- distributed/deploy/local.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/distributed/deploy/local.py b/distributed/deploy/local.py index 554459e43ac..b072290fe16 100644 --- a/distributed/deploy/local.py +++ b/distributed/deploy/local.py @@ -12,6 +12,7 @@ from .spec import SpecCluster from ..nanny import Nanny from ..scheduler import Scheduler +from ..security import Security from ..worker import Worker, parse_memory_limit logger = logging.getLogger(__name__) @@ -123,11 +124,12 @@ def __init__( self.status = None self.processes = processes - + security = security or Security() + if protocol is None: if host and "://" in host: protocol = host.split("://")[0] - elif security: + elif security and security.get_connection_args("scheduler")['require_encryption']: protocol = "tls://" elif not self.processes and not scheduler_port: protocol = "inproc://" From cd931abe978a3929995d0c9d0d1452ccce2ef878 Mon Sep 17 00:00:00 2001 From: Russ Bubley Date: Thu, 4 Jul 2019 23:53:16 +0100 Subject: [PATCH 2/4] flake8 --- distributed/deploy/local.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/distributed/deploy/local.py b/distributed/deploy/local.py index b072290fe16..357d92e6eb4 100644 --- a/distributed/deploy/local.py +++ b/distributed/deploy/local.py @@ -125,7 +125,7 @@ def __init__( self.status = None self.processes = processes security = security or Security() - + if protocol is None: if host and "://" in host: protocol = host.split("://")[0] From 0d611b70e9b29b26c0d0ce9f142e6996b2ff8960 Mon Sep 17 00:00:00 2001 From: Russ Bubley Date: Thu, 4 Jul 2019 23:55:36 +0100 Subject: [PATCH 3/4] black --- distributed/deploy/local.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/distributed/deploy/local.py b/distributed/deploy/local.py index 357d92e6eb4..705386c1e0b 100644 --- a/distributed/deploy/local.py +++ b/distributed/deploy/local.py @@ -129,7 +129,10 @@ def __init__( if protocol is None: if host and "://" in host: protocol = host.split("://")[0] - elif security and security.get_connection_args("scheduler")['require_encryption']: + elif ( + security + and security.get_connection_args("scheduler")["require_encryption"] + ): protocol = "tls://" elif not self.processes and not scheduler_port: protocol = "inproc://" From 81a4da678a2fd82f1bcb33afda0842efed7270d7 Mon Sep 17 00:00:00 2001 From: Russ Bubley Date: Wed, 10 Jul 2019 10:38:20 +0100 Subject: [PATCH 4/4] Changes per jcrist comment --- distributed/deploy/local.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/distributed/deploy/local.py b/distributed/deploy/local.py index 705386c1e0b..cb1a1511e20 100644 --- a/distributed/deploy/local.py +++ b/distributed/deploy/local.py @@ -129,10 +129,7 @@ def __init__( if protocol is None: if host and "://" in host: protocol = host.split("://")[0] - elif ( - security - and security.get_connection_args("scheduler")["require_encryption"] - ): + elif security and security.require_encryption: protocol = "tls://" elif not self.processes and not scheduler_port: protocol = "inproc://"