Use Packer 1.2 (#84)

This commit is contained in:
Vladislav Rassokhin 2018-04-25 14:22:38 +03:00 committed by Michael Kuzmin
parent 775d0007fa
commit 808a7ce57d
25 changed files with 77 additions and 64 deletions

34
Gopkg.lock generated
View File

@ -80,8 +80,10 @@
"communicator/ssh", "communicator/ssh",
"communicator/winrm", "communicator/winrm",
"helper/builder/testing", "helper/builder/testing",
"helper/common",
"helper/communicator", "helper/communicator",
"helper/config", "helper/config",
"helper/multistep",
"packer", "packer",
"packer/plugin", "packer/plugin",
"packer/rpc", "packer/rpc",
@ -89,8 +91,8 @@
"template/interpolate", "template/interpolate",
"version" "version"
] ]
revision = "6a8ae4b258d1bb0beece05c9fc3bbc1c186a0480" revision = "ab8811dca8f375344f36dfc32710b9790b2ec03e"
version = "v1.0.2" version = "v1.2.2"
[[projects]] [[projects]]
branch = "master" branch = "master"
@ -135,7 +137,7 @@
".", ".",
"fat" "fat"
] ]
revision = "7bae45d9a684750e82b97ff320c82556614e621b" revision = "b7b9ca407ffff465de12fc37ccbb81ea8b428c43"
[[projects]] [[projects]]
branch = "master" branch = "master"
@ -149,12 +151,6 @@
packages = ["."] packages = ["."]
revision = "00c29f56e2386353d58c599509e8dc3801b0d716" revision = "00c29f56e2386353d58c599509e8dc3801b0d716"
[[projects]]
branch = "master"
name = "github.com/mitchellh/multistep"
packages = ["."]
revision = "391576a156a54cfbb4cf5d5eda40cf6ffa3e3a4d"
[[projects]] [[projects]]
branch = "master" branch = "master"
name = "github.com/mitchellh/reflectwalk" name = "github.com/mitchellh/reflectwalk"
@ -182,14 +178,14 @@
[[projects]] [[projects]]
name = "github.com/pkg/sftp" name = "github.com/pkg/sftp"
packages = ["."] packages = ["."]
revision = "49488377fa2f14143ba3067cf7555f60f6c7b550" revision = "43ec6c679d353f6e077d3965dc74f6d996eb4a09"
version = "1.5.0" version = "1.5.1"
[[projects]] [[projects]]
name = "github.com/ugorji/go" name = "github.com/ugorji/go"
packages = ["codec"] packages = ["codec"]
revision = "9831f2c3ac1068a78f50999a30db84270f647af6" revision = "b4c50a2b199d93b13dc15e78929cfb23bfdf21ab"
version = "v1.1" version = "v1.1.1"
[[projects]] [[projects]]
name = "github.com/vmware/govmomi" name = "github.com/vmware/govmomi"
@ -226,13 +222,13 @@
"ssh", "ssh",
"ssh/agent" "ssh/agent"
] ]
revision = "88942b9c40a4c9d203b82b3731787b672d6e809b" revision = "d6449816ce06963d9d136eee5a56fca5b0616e7e"
[[projects]] [[projects]]
branch = "master" branch = "master"
name = "golang.org/x/mobile" name = "golang.org/x/mobile"
packages = ["event/key"] packages = ["event/key"]
revision = "598bfe4b20d39a660581f014b68e60c5ad425336" revision = "1f177cbe4ddf911017472e9532c6ca3a99949d53"
[[projects]] [[projects]]
branch = "master" branch = "master"
@ -240,9 +236,11 @@
packages = [ packages = [
"html", "html",
"html/atom", "html/atom",
"html/charset" "html/charset",
"internal/socks",
"proxy"
] ]
revision = "6078986fec03a1dcc236c34816c71b0e05018fda" revision = "500e7a4f953ddaf55d316b4d3adc516aa0379622"
[[projects]] [[projects]]
name = "golang.org/x/text" name = "golang.org/x/text"
@ -271,6 +269,6 @@
[solve-meta] [solve-meta]
analyzer-name = "dep" analyzer-name = "dep"
analyzer-version = 1 analyzer-version = 1
inputs-digest = "edb4fc0cd7c29895ef0cb47e8323311bacdba397dd57f12217ac8ea9dce6a31d" inputs-digest = "20177d3d587549d23b3ddea4eefc1fc03aa3436c372843bc76f98052b25432b7"
solver-name = "gps-cdcl" solver-name = "gps-cdcl"
solver-version = 1 solver-version = 1

View File

@ -1,6 +1,6 @@
[[constraint]] [[constraint]]
name = "github.com/hashicorp/packer" name = "github.com/hashicorp/packer"
version = "=1.0.2" version = "=1.2.2"
[[override]] [[override]]
name = "github.com/masterzen/azure-sdk-for-go" name = "github.com/masterzen/azure-sdk-for-go"

View File

@ -6,7 +6,7 @@ import (
"github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/packer"
"github.com/jetbrains-infra/packer-builder-vsphere/common" "github.com/jetbrains-infra/packer-builder-vsphere/common"
"github.com/jetbrains-infra/packer-builder-vsphere/driver" "github.com/jetbrains-infra/packer-builder-vsphere/driver"
"github.com/mitchellh/multistep" "github.com/hashicorp/packer/helper/multistep"
) )
type Builder struct { type Builder struct {

View File

@ -1,11 +1,12 @@
package clone package clone
import ( import (
"github.com/mitchellh/multistep" "github.com/hashicorp/packer/helper/multistep"
"github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/packer"
"fmt" "fmt"
"github.com/jetbrains-infra/packer-builder-vsphere/driver" "github.com/jetbrains-infra/packer-builder-vsphere/driver"
"github.com/jetbrains-infra/packer-builder-vsphere/common" "github.com/jetbrains-infra/packer-builder-vsphere/common"
"context"
) )
type CloneConfig struct { type CloneConfig struct {
@ -28,7 +29,7 @@ type StepCloneVM struct {
config *CloneConfig config *CloneConfig
} }
func (s *StepCloneVM) Run(state multistep.StateBag) multistep.StepAction { func (s *StepCloneVM) Run(_ context.Context, state multistep.StateBag) multistep.StepAction {
ui := state.Get("ui").(packer.Ui) ui := state.Get("ui").(packer.Ui)
d := state.Get("driver").(*driver.Driver) d := state.Get("driver").(*driver.Driver)

View File

@ -4,14 +4,15 @@ import (
"github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/packer"
"github.com/jetbrains-infra/packer-builder-vsphere/common" "github.com/jetbrains-infra/packer-builder-vsphere/common"
"github.com/jetbrains-infra/packer-builder-vsphere/driver" "github.com/jetbrains-infra/packer-builder-vsphere/driver"
"github.com/mitchellh/multistep" "github.com/hashicorp/packer/helper/multistep"
"context"
) )
type StepConfigureHardware struct { type StepConfigureHardware struct {
config *common.HardwareConfig config *common.HardwareConfig
} }
func (s *StepConfigureHardware) Run(state multistep.StateBag) multistep.StepAction { func (s *StepConfigureHardware) Run(_ context.Context, state multistep.StateBag) multistep.StepAction {
ui := state.Get("ui").(packer.Ui) ui := state.Get("ui").(packer.Ui)
vm := state.Get("vm").(*driver.VirtualMachine) vm := state.Get("vm").(*driver.VirtualMachine)

View File

@ -1,7 +1,7 @@
package common package common
import ( import (
"github.com/mitchellh/multistep" "github.com/hashicorp/packer/helper/multistep"
"errors" "errors"
) )

View File

@ -5,7 +5,7 @@ import (
"io/ioutil" "io/ioutil"
packerssh "github.com/hashicorp/packer/communicator/ssh" packerssh "github.com/hashicorp/packer/communicator/ssh"
"github.com/mitchellh/multistep" "github.com/hashicorp/packer/helper/multistep"
"golang.org/x/crypto/ssh" "golang.org/x/crypto/ssh"
"github.com/hashicorp/packer/helper/communicator" "github.com/hashicorp/packer/helper/communicator"
) )

View File

@ -1,9 +1,10 @@
package common package common
import ( import (
"github.com/mitchellh/multistep" "github.com/hashicorp/packer/helper/multistep"
"fmt" "fmt"
"github.com/jetbrains-infra/packer-builder-vsphere/driver" "github.com/jetbrains-infra/packer-builder-vsphere/driver"
"context"
) )
type ConnectConfig struct { type ConnectConfig struct {
@ -34,8 +35,8 @@ type StepConnect struct {
Config *ConnectConfig Config *ConnectConfig
} }
func (s *StepConnect) Run(state multistep.StateBag) multistep.StepAction { func (s *StepConnect) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction {
d, err := driver.NewDriver(&driver.ConnectConfig{ d, err := driver.NewDriver(ctx, &driver.ConnectConfig{
VCenterServer: s.Config.VCenterServer, VCenterServer: s.Config.VCenterServer,
Username: s.Config.Username, Username: s.Config.Username,
Password: s.Config.Password, Password: s.Config.Password,

View File

@ -1,12 +1,13 @@
package common package common
import ( import (
"github.com/mitchellh/multistep" "github.com/hashicorp/packer/helper/multistep"
"github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/packer"
"fmt" "fmt"
"github.com/jetbrains-infra/packer-builder-vsphere/driver" "github.com/jetbrains-infra/packer-builder-vsphere/driver"
"strings" "strings"
"time" "time"
"context"
) )
type RunConfig struct { type RunConfig struct {
@ -35,7 +36,7 @@ type StepRun struct {
Config *RunConfig Config *RunConfig
} }
func (s *StepRun) Run(state multistep.StateBag) multistep.StepAction { func (s *StepRun) Run(_ context.Context, state multistep.StateBag) multistep.StepAction {
ui := state.Get("ui").(packer.Ui) ui := state.Get("ui").(packer.Ui)
vm := state.Get("vm").(*driver.VirtualMachine) vm := state.Get("vm").(*driver.VirtualMachine)

View File

@ -1,13 +1,14 @@
package common package common
import ( import (
"github.com/mitchellh/multistep" "github.com/hashicorp/packer/helper/multistep"
"github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/packer"
"fmt" "fmt"
"log" "log"
"time" "time"
"bytes" "bytes"
"github.com/jetbrains-infra/packer-builder-vsphere/driver" "github.com/jetbrains-infra/packer-builder-vsphere/driver"
"context"
) )
type ShutdownConfig struct { type ShutdownConfig struct {
@ -37,7 +38,7 @@ type StepShutdown struct {
Config *ShutdownConfig Config *ShutdownConfig
} }
func (s *StepShutdown) Run(state multistep.StateBag) multistep.StepAction { func (s *StepShutdown) Run(_ context.Context, state multistep.StateBag) multistep.StepAction {
ui := state.Get("ui").(packer.Ui) ui := state.Get("ui").(packer.Ui)
comm := state.Get("communicator").(packer.Communicator) comm := state.Get("communicator").(packer.Communicator)
vm := state.Get("vm").(*driver.VirtualMachine) vm := state.Get("vm").(*driver.VirtualMachine)

View File

@ -1,16 +1,17 @@
package common package common
import ( import (
"github.com/mitchellh/multistep" "github.com/hashicorp/packer/helper/multistep"
"github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/packer"
"github.com/jetbrains-infra/packer-builder-vsphere/driver" "github.com/jetbrains-infra/packer-builder-vsphere/driver"
"context"
) )
type StepCreateSnapshot struct{ type StepCreateSnapshot struct{
CreateSnapshot bool CreateSnapshot bool
} }
func (s *StepCreateSnapshot) Run(state multistep.StateBag) multistep.StepAction { func (s *StepCreateSnapshot) Run(_ context.Context, state multistep.StateBag) multistep.StepAction {
ui := state.Get("ui").(packer.Ui) ui := state.Get("ui").(packer.Ui)
vm := state.Get("vm").(*driver.VirtualMachine) vm := state.Get("vm").(*driver.VirtualMachine)

View File

@ -1,16 +1,17 @@
package common package common
import ( import (
"github.com/mitchellh/multistep" "github.com/hashicorp/packer/helper/multistep"
"github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/packer"
"github.com/jetbrains-infra/packer-builder-vsphere/driver" "github.com/jetbrains-infra/packer-builder-vsphere/driver"
"context"
) )
type StepConvertToTemplate struct{ type StepConvertToTemplate struct{
ConvertToTemplate bool ConvertToTemplate bool
} }
func (s *StepConvertToTemplate) Run(state multistep.StateBag) multistep.StepAction { func (s *StepConvertToTemplate) Run(_ context.Context, state multistep.StateBag) multistep.StepAction {
ui := state.Get("ui").(packer.Ui) ui := state.Get("ui").(packer.Ui)
vm := state.Get("vm").(*driver.VirtualMachine) vm := state.Get("vm").(*driver.VirtualMachine)

View File

@ -1,16 +1,17 @@
package common package common
import ( import (
"github.com/mitchellh/multistep" "github.com/hashicorp/packer/helper/multistep"
"fmt" "fmt"
"github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/packer"
"github.com/jetbrains-infra/packer-builder-vsphere/driver" "github.com/jetbrains-infra/packer-builder-vsphere/driver"
"time" "time"
"context"
) )
type StepWaitForIp struct{} type StepWaitForIp struct{}
func (s *StepWaitForIp) Run(state multistep.StateBag) multistep.StepAction { func (s *StepWaitForIp) Run(_ context.Context, state multistep.StateBag) multistep.StepAction {
ui := state.Get("ui").(packer.Ui) ui := state.Get("ui").(packer.Ui)
vm := state.Get("vm").(*driver.VirtualMachine) vm := state.Get("vm").(*driver.VirtualMachine)

View File

@ -9,6 +9,7 @@ import (
"github.com/jetbrains-infra/packer-builder-vsphere/driver" "github.com/jetbrains-infra/packer-builder-vsphere/driver"
"testing" "testing"
"github.com/jetbrains-infra/packer-builder-vsphere/common" "github.com/jetbrains-infra/packer-builder-vsphere/common"
"context"
) )
func NewVMName() string { func NewVMName() string {
@ -34,7 +35,7 @@ func RenderConfig(config map[string]interface{}) string {
func TestConn(t *testing.T) *driver.Driver { func TestConn(t *testing.T) *driver.Driver {
d, err := driver.NewDriver(&driver.ConnectConfig{ d, err := driver.NewDriver(context.TODO(), &driver.ConnectConfig{
VCenterServer: "vcenter.vsphere65.test", VCenterServer: "vcenter.vsphere65.test",
Username: "root", Username: "root",
Password: "jetbrains", Password: "jetbrains",

View File

@ -28,8 +28,7 @@ type ConnectConfig struct {
Datacenter string Datacenter string
} }
func NewDriver(config *ConnectConfig) (*Driver, error) { func NewDriver(ctx context.Context, config *ConnectConfig) (*Driver, error) {
ctx := context.TODO()
vcenter_url, err := url.Parse(fmt.Sprintf("https://%v/sdk", config.VCenterServer)) vcenter_url, err := url.Parse(fmt.Sprintf("https://%v/sdk", config.VCenterServer))
if err != nil { if err != nil {

View File

@ -5,13 +5,14 @@ import (
"testing" "testing"
"time" "time"
"math/rand" "math/rand"
"context"
) )
// Defines whether acceptance tests should be run // Defines whether acceptance tests should be run
const TestHostName = "esxi-1.vsphere65.test" const TestHostName = "esxi-1.vsphere65.test"
func newTestDriver(t *testing.T) *Driver { func newTestDriver(t *testing.T) *Driver {
d, err := NewDriver(&ConnectConfig{ d, err := NewDriver(context.TODO(), &ConnectConfig{
VCenterServer: "vcenter.vsphere65.test", VCenterServer: "vcenter.vsphere65.test",
Username: "root", Username: "root",
Password: "jetbrains", Password: "jetbrains",

View File

@ -3,10 +3,11 @@ package main
import ( import (
"github.com/jetbrains-infra/packer-builder-vsphere/driver" "github.com/jetbrains-infra/packer-builder-vsphere/driver"
"fmt" "fmt"
"context"
) )
func main() { func main() {
d, err := driver.NewDriver(&driver.ConnectConfig{ d, err := driver.NewDriver(context.TODO(), &driver.ConnectConfig{
VCenterServer: "vcenter.vsphere65.test", VCenterServer: "vcenter.vsphere65.test",
Username: "root", Username: "root",
Password: "jetbrains", Password: "jetbrains",

View File

@ -2,11 +2,11 @@ package iso
import ( import (
packerCommon "github.com/hashicorp/packer/common" packerCommon "github.com/hashicorp/packer/common"
"github.com/hashicorp/packer/helper/communicator"
"github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/packer"
"github.com/jetbrains-infra/packer-builder-vsphere/common" "github.com/jetbrains-infra/packer-builder-vsphere/common"
"github.com/jetbrains-infra/packer-builder-vsphere/driver" "github.com/jetbrains-infra/packer-builder-vsphere/driver"
"github.com/mitchellh/multistep" "github.com/hashicorp/packer/helper/multistep"
"github.com/hashicorp/packer/helper/communicator"
) )
type Builder struct { type Builder struct {

View File

@ -1,11 +1,11 @@
package iso package iso
import ( import (
"fmt"
"github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/packer"
"github.com/jetbrains-infra/packer-builder-vsphere/driver" "github.com/jetbrains-infra/packer-builder-vsphere/driver"
"github.com/mitchellh/multistep" "github.com/hashicorp/packer/helper/multistep"
"fmt"
"context"
) )
type CDRomConfig struct { type CDRomConfig struct {
@ -20,7 +20,7 @@ type StepAddCDRom struct {
Config *CDRomConfig Config *CDRomConfig
} }
func (s *StepAddCDRom) Run(state multistep.StateBag) multistep.StepAction { func (s *StepAddCDRom) Run(_ context.Context, state multistep.StateBag) multistep.StepAction {
ui := state.Get("ui").(packer.Ui) ui := state.Get("ui").(packer.Ui)
vm := state.Get("vm").(*driver.VirtualMachine) vm := state.Get("vm").(*driver.VirtualMachine)

View File

@ -1,11 +1,11 @@
package iso package iso
import ( import (
"fmt" "github.com/hashicorp/packer/helper/multistep"
"github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/packer"
"github.com/jetbrains-infra/packer-builder-vsphere/driver" "github.com/jetbrains-infra/packer-builder-vsphere/driver"
"github.com/mitchellh/multistep" "fmt"
"context"
) )
type FloppyConfig struct { type FloppyConfig struct {
@ -32,7 +32,7 @@ type StepAddFloppy struct {
Host string Host string
} }
func (s *StepAddFloppy) Run(state multistep.StateBag) multistep.StepAction { func (s *StepAddFloppy) Run(_ context.Context, state multistep.StateBag) multistep.StepAction {
err := s.runImpl(state) err := s.runImpl(state)
if err != nil { if err != nil {
state.Put("error", fmt.Errorf("error adding floppy: %v", err)) state.Put("error", fmt.Errorf("error adding floppy: %v", err))

View File

@ -3,7 +3,7 @@ package iso
import ( import (
"github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/packer"
"github.com/jetbrains-infra/packer-builder-vsphere/driver" "github.com/jetbrains-infra/packer-builder-vsphere/driver"
"github.com/mitchellh/multistep" "github.com/hashicorp/packer/helper/multistep"
"fmt" "fmt"
"time" "time"
"strings" "strings"
@ -12,6 +12,7 @@ import (
"github.com/hashicorp/packer/common" "github.com/hashicorp/packer/common"
"os" "os"
"log" "log"
"context"
) )
type BootConfig struct { type BootConfig struct {
@ -63,7 +64,7 @@ func init() {
} }
} }
func (s *StepBootCommand) Run(state multistep.StateBag) multistep.StepAction { func (s *StepBootCommand) Run(_ context.Context, state multistep.StateBag) multistep.StepAction {
ui := state.Get("ui").(packer.Ui) ui := state.Get("ui").(packer.Ui)
vm := state.Get("vm").(*driver.VirtualMachine) vm := state.Get("vm").(*driver.VirtualMachine)

View File

@ -3,8 +3,9 @@ package iso
import ( import (
"github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/packer"
"github.com/jetbrains-infra/packer-builder-vsphere/driver" "github.com/jetbrains-infra/packer-builder-vsphere/driver"
"github.com/mitchellh/multistep" "github.com/hashicorp/packer/helper/multistep"
"fmt" "fmt"
"context"
) )
type ConfigParamsConfig struct { type ConfigParamsConfig struct {
@ -19,7 +20,7 @@ type StepConfigParams struct {
Config *ConfigParamsConfig Config *ConfigParamsConfig
} }
func (s *StepConfigParams) Run(state multistep.StateBag) multistep.StepAction { func (s *StepConfigParams) Run(_ context.Context, state multistep.StateBag) multistep.StepAction {
ui := state.Get("ui").(packer.Ui) ui := state.Get("ui").(packer.Ui)
vm := state.Get("vm").(*driver.VirtualMachine) vm := state.Get("vm").(*driver.VirtualMachine)

View File

@ -5,7 +5,8 @@ import (
"github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/packer"
"github.com/jetbrains-infra/packer-builder-vsphere/common" "github.com/jetbrains-infra/packer-builder-vsphere/common"
"github.com/jetbrains-infra/packer-builder-vsphere/driver" "github.com/jetbrains-infra/packer-builder-vsphere/driver"
"github.com/mitchellh/multistep" "github.com/hashicorp/packer/helper/multistep"
"context"
) )
type CreateConfig struct { type CreateConfig struct {
@ -55,7 +56,7 @@ type StepCreateVM struct {
Config *CreateConfig Config *CreateConfig
} }
func (s *StepCreateVM) Run(state multistep.StateBag) multistep.StepAction { func (s *StepCreateVM) Run(_ context.Context, state multistep.StateBag) multistep.StepAction {
ui := state.Get("ui").(packer.Ui) ui := state.Get("ui").(packer.Ui)
d := state.Get("driver").(*driver.Driver) d := state.Get("driver").(*driver.Driver)

View File

@ -5,13 +5,14 @@ import (
"github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/packer"
"github.com/jetbrains-infra/packer-builder-vsphere/driver" "github.com/jetbrains-infra/packer-builder-vsphere/driver"
"github.com/mitchellh/multistep" "github.com/hashicorp/packer/helper/multistep"
"github.com/vmware/govmomi/vim25/types" "github.com/vmware/govmomi/vim25/types"
"context"
) )
type StepRemoveCDRom struct{} type StepRemoveCDRom struct{}
func (s *StepRemoveCDRom) Run(state multistep.StateBag) multistep.StepAction { func (s *StepRemoveCDRom) Run(_ context.Context, state multistep.StateBag) multistep.StepAction {
ui := state.Get("ui").(packer.Ui) ui := state.Get("ui").(packer.Ui)
vm := state.Get("vm").(*driver.VirtualMachine) vm := state.Get("vm").(*driver.VirtualMachine)

View File

@ -5,8 +5,9 @@ import (
"github.com/hashicorp/packer/packer" "github.com/hashicorp/packer/packer"
"github.com/jetbrains-infra/packer-builder-vsphere/driver" "github.com/jetbrains-infra/packer-builder-vsphere/driver"
"github.com/mitchellh/multistep" "github.com/hashicorp/packer/helper/multistep"
"github.com/vmware/govmomi/vim25/types" "github.com/vmware/govmomi/vim25/types"
"context"
) )
type StepRemoveFloppy struct { type StepRemoveFloppy struct {
@ -14,7 +15,7 @@ type StepRemoveFloppy struct {
Host string Host string
} }
func (s *StepRemoveFloppy) Run(state multistep.StateBag) multistep.StepAction { func (s *StepRemoveFloppy) Run(_ context.Context, state multistep.StateBag) multistep.StepAction {
ui := state.Get("ui").(packer.Ui) ui := state.Get("ui").(packer.Ui)
vm := state.Get("vm").(*driver.VirtualMachine) vm := state.Get("vm").(*driver.VirtualMachine)
d := state.Get("driver").(*driver.Driver) d := state.Get("driver").(*driver.Driver)