Skip to content

Commit

Permalink
Update code to conform with upstream changes in winrm
Browse files Browse the repository at this point in the history
  • Loading branch information
RincewindsHat committed Mar 17, 2023
1 parent efba0c0 commit 2520fde
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions check.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@ package main

import (
"bytes"
"context"
"errors"
"fmt"
"os"
"strings"
"time"

"github.com/masterzen/winrm"
log "github.com/sirupsen/logrus"
"github.com/spf13/pflag"
"golang.org/x/crypto/ssh"
"os"
"strings"
"time"
)

const (
Expand Down Expand Up @@ -242,7 +244,9 @@ func (c *Config) Run(timeout time.Duration) (err error, rc int, output string) {
stderr = &bytes.Buffer{}
)

rc, err = client.Run(c.BuildCommand(), stdout, stderr)
ctx := context.Background()

rc, err = client.RunWithContext(ctx, c.BuildCommand(), stdout, stderr)
if err != nil {
err = fmt.Errorf("execution of remote cmd failed: %w", err)
return
Expand Down

0 comments on commit 2520fde

Please sign in to comment.