summaryrefslogtreecommitdiff
path: root/cmd/podman
diff options
context:
space:
mode:
authorPaul Holzinger <pholzing@redhat.com>2022-07-21 11:41:13 +0200
committerPaul Holzinger <pholzing@redhat.com>2022-07-21 18:04:11 +0200
commit604920dd1101c030545f4ff547b86a507b5c3ff1 (patch)
treeb17fbb83d379936ac14a387ca027452b41d819c4 /cmd/podman
parentee35ce86d0766a52ce223f2ac765b5d787e4ab89 (diff)
downloadpodman-604920dd1101c030545f4ff547b86a507b5c3ff1.tar.gz
podman-604920dd1101c030545f4ff547b86a507b5c3ff1.tar.bz2
podman-604920dd1101c030545f4ff547b86a507b5c3ff1.zip
fix some pkg/machine/e2e test to read stderr
Also fix the machine ssh code order to provide a better error message. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'cmd/podman')
-rw-r--r--cmd/podman/machine/ssh.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/cmd/podman/machine/ssh.go b/cmd/podman/machine/ssh.go
index cb2f62f51..8534b8efa 100644
--- a/cmd/podman/machine/ssh.go
+++ b/cmd/podman/machine/ssh.go
@@ -80,6 +80,11 @@ func ssh(cmd *cobra.Command, args []string) error {
}
}
+ vm, err = provider.LoadVMByName(vmName)
+ if err != nil {
+ return fmt.Errorf("vm %s not found: %w", vmName, err)
+ }
+
if !validVM && sshOpts.Username == "" {
sshOpts.Username, err = remoteConnectionUsername()
if err != nil {
@@ -87,10 +92,6 @@ func ssh(cmd *cobra.Command, args []string) error {
}
}
- vm, err = provider.LoadVMByName(vmName)
- if err != nil {
- return fmt.Errorf("vm %s not found: %w", vmName, err)
- }
err = vm.SSH(vmName, sshOpts)
return utils.HandleOSExecError(err)
}