Merge pull request #2487 from frapposelli/vsphere-path-fix

Fix for vSphere driver boot2docker ISO issues
This commit is contained in:
Jean-Laurent de Morlhon 2015-12-03 15:33:25 +01:00
commit 3f0625fbac
2 changed files with 3 additions and 5 deletions

View File

@ -63,7 +63,7 @@ func (conn VcConn) DatastoreMkdir(dirName string) error {
func (conn VcConn) DatastoreUpload(localPath, destination string) error { func (conn VcConn) DatastoreUpload(localPath, destination string) error {
stdout, err := conn.DatastoreLs(destination) stdout, err := conn.DatastoreLs(destination)
if err == nil && strings.Contains(stdout, B2DISOName) { if err == nil && strings.Contains(stdout, isoFilename) {
log.Infof("boot2docker ISO already uploaded, skipping upload... ") log.Infof("boot2docker ISO already uploaded, skipping upload... ")
return nil return nil
} }
@ -71,7 +71,7 @@ func (conn VcConn) DatastoreUpload(localPath, destination string) error {
log.Infof("Uploading %s to %s on datastore %s of vCenter %s... ", log.Infof("Uploading %s to %s on datastore %s of vCenter %s... ",
localPath, destination, conn.driver.Datastore, conn.driver.IP) localPath, destination, conn.driver.Datastore, conn.driver.IP)
dsPath := fmt.Sprintf("%s/%s", destination, B2DISOName) dsPath := fmt.Sprintf("%s/%s", destination, isoFilename)
args := []string{"datastore.upload"} args := []string{"datastore.upload"}
args = conn.AppendConnectionString(args) args = conn.AppendConnectionString(args)
args = append(args, fmt.Sprintf("--ds=%s", conn.driver.Datastore)) args = append(args, fmt.Sprintf("--ds=%s", conn.driver.Datastore))

View File

@ -10,7 +10,6 @@ import (
"io/ioutil" "io/ioutil"
"net" "net"
"os" "os"
"path/filepath"
"strings" "strings"
"time" "time"
@ -26,7 +25,6 @@ import (
const ( const (
isoFilename = "boot2docker.iso" isoFilename = "boot2docker.iso"
B2DISOName = isoFilename
B2DUser = "docker" B2DUser = "docker"
B2DPass = "tcuser" B2DPass = "tcuser"
) )
@ -172,7 +170,7 @@ func (d *Driver) SetConfigFromFlags(flags drivers.DriverOptions) error {
d.SwarmHost = flags.String("swarm-host") d.SwarmHost = flags.String("swarm-host")
d.SwarmDiscovery = flags.String("swarm-discovery") d.SwarmDiscovery = flags.String("swarm-discovery")
d.ISO = filepath.Join(d.StorePath, isoFilename) d.ISO = d.ResolveStorePath(isoFilename)
return nil return nil
} }