mirror of https://github.com/containers/podman.git
only read ssh_config for non machine connections
For machine we know we have all the info we need so there is no reason to read and parse another file. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
parent
cbb2820a7e
commit
71f1f52894
|
|
@ -162,7 +162,11 @@ func sshClient(_url *url.URL, uri string, identity string, machine bool) (Connec
|
||||||
return connection, err
|
return connection, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// ssh_config
|
|
||||||
|
// only parse ssh_config when we are not connecting to a machine
|
||||||
|
// For machine connections we always have the full URL in the
|
||||||
|
// system connection so reading the file is just unnecessary.
|
||||||
|
if !machine {
|
||||||
alias := _url.Hostname()
|
alias := _url.Hostname()
|
||||||
cfg := ssh_config.DefaultUserSettings
|
cfg := ssh_config.DefaultUserSettings
|
||||||
cfg.IgnoreErrors = true
|
cfg.IgnoreErrors = true
|
||||||
|
|
@ -225,6 +229,7 @@ func sshClient(_url *url.URL, uri string, identity string, machine bool) (Connec
|
||||||
logrus.Debugf(" Port: %d", port)
|
logrus.Debugf(" Port: %d", port)
|
||||||
logrus.Debugf(" IdentityFile: %q", identity)
|
logrus.Debugf(" IdentityFile: %q", identity)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
conn, err := ssh.Dial(&ssh.ConnectionDialOptions{
|
conn, err := ssh.Dial(&ssh.ConnectionDialOptions{
|
||||||
Host: uri,
|
Host: uri,
|
||||||
Identity: identity,
|
Identity: identity,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue