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 {
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... ")
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... ",
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 = conn.AppendConnectionString(args)
args = append(args, fmt.Sprintf("--ds=%s", conn.driver.Datastore))

View File

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