Repository: dask/distributed

Issue:
dask-ssh fails after removing local-directory keyword from dask_scheduler
PR #3620 removed local-directory keyword from `dask_scheduler` cli. Now, `dask-ssh` cannot be launched with this keyword. 

```
$ python -m distributed.cli.dask_ssh localhost --local-directory /tmp

---------------------------------------------------------------
Worker nodes:
  0: localhost

scheduler node: localhost:8786
---------------------------------------------------------------

[ scheduler localhost:8786 ] : /Users/abduh/workplaces/dask-env/bin/python -m distributed.cli.dask_scheduler --port 8786 --local-directory /tmp
[ worker localhost ] : /Users/abduh/workplaces/dask-env/bin/python -m distributed.cli.dask_worker localhost:8786 --nthreads 0 --host localhost --memory-limit auto --local-directory /tmp
[ scheduler localhost:8786 ] : Usage: dask_scheduler.py [OPTIONS] [PRELOAD_ARGV]...
[ scheduler localhost:8786 ] : 
[ scheduler localhost:8786 ] : Error: no such option: --local-directory
[ scheduler localhost:8786 ] : remote process exited with exit status 2
[ scheduler localhost:8786 ] : remote process exited with exit status 2
```
I will work on a fix. 


Discussion:

Resolving patch:
diff --git a/distributed/cli/dask_ssh.py b/distributed/cli/dask_ssh.py
--- a/distributed/cli/dask_ssh.py
+++ b/distributed/cli/dask_ssh.py
@@ -81,9 +81,7 @@
     "--local-directory",
     default=None,
     type=click.Path(exists=True),
-    help=(
-        "Directory to use on all cluster nodes to place workers " "and scheduler files."
-    ),
+    help=("Directory to use on all cluster nodes to place workers files."),
 )
 @click.option(
     "--remote-python", default=None, type=str, help="Path to Python on remote nodes."
diff --git a/distributed/deploy/old_ssh.py b/distributed/deploy/old_ssh.py
--- a/distributed/deploy/old_ssh.py
+++ b/distributed/deploy/old_ssh.py
@@ -209,24 +209,12 @@ def communicate():
 
 
 def start_scheduler(
-    logdir,
-    addr,
-    port,
-    ssh_username,
-    ssh_port,
-    ssh_private_key,
-    remote_python=None,
-    local_directory=None,
+    logdir, addr, port, ssh_username, ssh_port, ssh_private_key, remote_python=None,
 ):
     cmd = "{python} -m distributed.cli.dask_scheduler --port {port}".format(
         python=remote_python or sys.executable, port=port, logdir=logdir
     )
 
-    if local_directory is not None:
-        cmd += " --local-directory {local_directory}".format(
-            local_directory=local_directory
-        )
-
     # Optionally re-direct stdout and stderr to a logfile
     if logdir is not None:
         cmd = "mkdir -p {logdir} && ".format(logdir=logdir) + cmd
@@ -422,7 +410,6 @@ def __init__(
             ssh_port,
             ssh_private_key,
             remote_python,
-            local_directory,
         )
 
         # Start worker nodes


Test patch:
diff --git a/distributed/deploy/tests/test_ssh.py b/distributed/deploy/tests/test_ssh.py
--- a/distributed/deploy/tests/test_ssh.py
+++ b/distributed/deploy/tests/test_ssh.py
@@ -63,6 +63,24 @@ def test_defer_to_old(loop):
             assert isinstance(c, OldSSHCluster)
 
 
+@pytest.mark.avoid_travis
+def test_old_ssh_wih_local_dir(loop):
+    with pytest.warns(Warning):
+        from distributed.deploy.old_ssh import SSHCluster as OldSSHCluster
+
+        with OldSSHCluster(
+            scheduler_addr="127.0.0.1",
+            scheduler_port=7437,
+            worker_addrs=["127.0.0.1", "127.0.0.1"],
+            local_directory="/tmp",
+        ) as c:
+            assert len(c.workers) == 2
+            with Client(c) as client:
+                result = client.submit(lambda x: x + 1, 10)
+                result = result.result()
+                assert result == 11
+
+
 @pytest.mark.asyncio
 async def test_config_inherited_by_subprocess(loop):
     def f(x):