github.phpd.cn/hashicorp/packer@v1.3.2/builder/vmware/common/driver_workstation10.go (about) 1 package common 2 3 import ( 4 "os/exec" 5 ) 6 7 const VMWARE_WS_VERSION = "10" 8 9 // Workstation10Driver is a driver that can run VMware Workstation 10 10 // installations. 11 12 type Workstation10Driver struct { 13 Workstation9Driver 14 } 15 16 func (d *Workstation10Driver) Clone(dst, src string, linked bool) error { 17 18 var cloneType string 19 if linked { 20 cloneType = "linked" 21 } else { 22 cloneType = "full" 23 } 24 25 cmd := exec.Command(d.Workstation9Driver.VmrunPath, 26 "-T", "ws", 27 "clone", src, dst, 28 cloneType) 29 30 if _, _, err := runAndLog(cmd); err != nil { 31 return err 32 } 33 34 return nil 35 } 36 37 func (d *Workstation10Driver) Verify() error { 38 if err := d.Workstation9Driver.Verify(); err != nil { 39 return err 40 } 41 42 return workstationVerifyVersion(VMWARE_WS_VERSION) 43 } 44 45 func (d *Workstation10Driver) GetVmwareDriver() VmwareDriver { 46 return d.Workstation9Driver.VmwareDriver 47 }