Commit 418ed0cb authored by Ross Smith II's avatar Ross Smith II

Merge pull request #1316 from yuuzi41/fix-esx5-path-separator

fix invalid esx5 path separator in windows
parents 5d0cd967 982e523b
......@@ -64,7 +64,7 @@ func (d *ESX5Driver) Stop(vmxPathLocal string) error {
}
func (d *ESX5Driver) Register(vmxPathLocal string) error {
vmxPath := filepath.Join(d.outputDir, filepath.Base(vmxPathLocal))
vmxPath := filepath.ToSlash(filepath.Join(d.outputDir, filepath.Base(vmxPathLocal)))
if err := d.upload(vmxPath, vmxPathLocal); err != nil {
return err
}
......@@ -92,7 +92,7 @@ func (d *ESX5Driver) UploadISO(localPath string) (string, error) {
}
finalPath := d.datastorePath(targetFile)
if err := d.mkdir(filepath.Dir(finalPath)); err != nil {
if err := d.mkdir(filepath.ToSlash(filepath.Dir(finalPath))); err != nil {
return "", err
}
......@@ -233,7 +233,7 @@ func (d *ESX5Driver) ListFiles() ([]string, error) {
continue
}
files = append(files, filepath.Join(d.outputDir, string(line)))
files = append(files, filepath.ToSlash(filepath.Join(d.outputDir, string(line))))
}
return files, nil
......@@ -261,7 +261,7 @@ func (d *ESX5Driver) String() string {
func (d *ESX5Driver) datastorePath(path string) string {
baseDir := filepath.Base(filepath.Dir(path))
return filepath.Join("/vmfs/volumes", d.Datastore, baseDir, filepath.Base(path))
return filepath.ToSlash(filepath.Join("/vmfs/volumes", d.Datastore, baseDir, filepath.Base(path)))
}
func (d *ESX5Driver) connect() error {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment