20522: Load dispatch key from file if configured as file:///...
[arvados.git] / lib / cloud / cloudtest / cmd.go
index 0ec79e1175dcda50d98609c55d4ff15d7e976d11..95fb2b50cb6e61e3d5946d70346f88cc8e01e90d 100644 (file)
@@ -18,7 +18,6 @@ import (
        "git.arvados.org/arvados.git/lib/dispatchcloud"
        "git.arvados.org/arvados.git/sdk/go/arvados"
        "git.arvados.org/arvados.git/sdk/go/ctxlog"
-       "golang.org/x/crypto/ssh"
 )
 
 var Command command
@@ -65,9 +64,9 @@ func (command) RunCommand(prog string, args []string, stdin io.Reader, stdout, s
        if err != nil {
                return 1
        }
-       key, err := ssh.ParsePrivateKey([]byte(cluster.Containers.DispatchPrivateKey))
+       key, err := config.LoadSSHKey(cluster.Containers.DispatchPrivateKey)
        if err != nil {
-               err = fmt.Errorf("error parsing configured Containers.DispatchPrivateKey: %s", err)
+               err = fmt.Errorf("error loading Containers.DispatchPrivateKey: %s", err)
                return 1
        }
        driver, ok := dispatchcloud.Drivers[cluster.Containers.CloudVMs.Driver]