Skip to content

Commit

Permalink
fixup imports
Browse files Browse the repository at this point in the history
Signed-off-by: Nitin Ravindran <[email protected]>
  • Loading branch information
aramprice authored and xtreme-nitin-ravindran committed Jul 18, 2024
1 parent a963299 commit 7df46f6
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 15 deletions.
7 changes: 4 additions & 3 deletions commandparser/construct.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ import (
"path/filepath"
"strings"

"github.com/google/subcommands"
"github.com/vmware/govmomi/guest"
"github.com/vmware/govmomi/object"

"github.com/cloudfoundry/stembuild/construct/config"
vcenterclientfactory "github.com/cloudfoundry/stembuild/iaas_cli/iaas_clients/factory"
"github.com/cloudfoundry/stembuild/iaas_cli/iaas_clients/guest_manager"
"github.com/cloudfoundry/stembuild/iaas_cli/iaas_clients/vcenter_manager"
"github.com/google/subcommands"
"github.com/vmware/govmomi/guest"
"github.com/vmware/govmomi/object"
)

//go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 -generate
Expand Down
3 changes: 2 additions & 1 deletion iaas_cli/iaas_clients/vcenter_manager/vcenter_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ import (
"path"
"strings"

"github.com/cloudfoundry/stembuild/iaas_cli/iaas_clients/guest_manager"
"github.com/vmware/govmomi/find"
"github.com/vmware/govmomi/guest"
"github.com/vmware/govmomi/object"
"github.com/vmware/govmomi/vim25"
"github.com/vmware/govmomi/vim25/types"

"github.com/cloudfoundry/stembuild/iaas_cli/iaas_clients/guest_manager"
)

//go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 -generate
Expand Down
8 changes: 4 additions & 4 deletions integration/construct/construct_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ import (
"testing"
"time"

"github.com/cloudfoundry/stembuild/remotemanager"
"github.com/cloudfoundry/stembuild/test/helpers"
"github.com/concourse/pool-resource/out"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"github.com/vmware/govmomi/govc/cli"
_ "github.com/vmware/govmomi/govc/device"
_ "github.com/vmware/govmomi/govc/importx"
_ "github.com/vmware/govmomi/govc/vm"
_ "github.com/vmware/govmomi/govc/vm/guest"
_ "github.com/vmware/govmomi/govc/vm/snapshot"

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"github.com/cloudfoundry/stembuild/remotemanager"
"github.com/cloudfoundry/stembuild/test/helpers"
)

func TestConstruct(t *testing.T) {
Expand Down
5 changes: 3 additions & 2 deletions integration/construct/construct_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import (
"path/filepath"
"time"

"github.com/cloudfoundry/stembuild/test/helpers"

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
. "github.com/onsi/gomega/gbytes"
. "github.com/onsi/gomega/gexec"

"github.com/cloudfoundry/stembuild/test/helpers"
)

const (
Expand All @@ -31,6 +31,7 @@ var _ = Describe("stembuild construct", func() {
AfterEach(func() {
_ = os.Remove(filepath.Join(workingDir, "LGPO.zip"))
})

Context("run successfully", func() {
BeforeEach(func() {
err := CopyFile(filepath.Join(workingDir, "assets", "LGPO.zip"), filepath.Join(workingDir, "LGPO.zip"))
Expand Down
2 changes: 1 addition & 1 deletion remotemanager/winrm_rebootchecker.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func NewRebootChecker(winrmRemoteManager RemoteManager) *RebootChecker {
return &RebootChecker{winrmRemoteManager}
}

// Inspired by Hashicorp Packer waitForRestart
// RebootHasFinished inspired by Hashicorp Packer waitForRestart
func (rc *RebootChecker) RebootHasFinished() (bool, error) {

exitCode, err := rc.remoteManager.ExecuteCommand(tryCheckReboot)
Expand Down
8 changes: 4 additions & 4 deletions remotemanager/winrm_remotemanager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ import (
"net/url"
"strconv"

"github.com/cloudfoundry/stembuild/remotemanager"
"github.com/cloudfoundry/stembuild/remotemanager/remotemanagerfakes"
"github.com/masterzen/winrm"

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
. "github.com/onsi/gomega/ghttp"

"github.com/cloudfoundry/stembuild/remotemanager"
"github.com/cloudfoundry/stembuild/remotemanager/remotemanagerfakes"
)

func setupTestServer() *Server {
Expand Down Expand Up @@ -153,6 +153,7 @@ var _ = Describe("WinRM RemoteManager", func() {

Expect(err).NotTo(HaveOccurred())
})

It("returns error if winrmclient cannot be created", func() {
winRMClientFactory := new(remotemanagerfakes.FakeWinRMClientFactoryI)
buildError := errors.New("unable to build a client")
Expand All @@ -176,7 +177,6 @@ var _ = Describe("WinRM RemoteManager", func() {

Expect(err).To(HaveOccurred())
Expect(err).To(MatchError(fmt.Errorf("failed to create winrm shell: some shell creation error")))

})
})
})

0 comments on commit 7df46f6

Please sign in to comment.