cp/mirror: Use proper paths for windows during copyObject. (#1897)

Fixes #1857
This commit is contained in:
Harshavardhana
2016-11-27 12:26:02 +05:30
committed by Krishna Srinivas
parent 0a42e2969a
commit 2412aae68f
2 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -183,7 +183,8 @@ func doCopy(cpURLs URLs, progressReader *progressBar, accountingReader *accounte
// If source/target are object storage their aliases must be the same.
if sourceAlias == targetAlias {
// Do not include alias inside path for ObjStore -> ObjStore.
err := copySourceStreamFromAlias(targetAlias, targetURL.String(), sourceURL.Path, length, progress)
sourcePath := filepath.ToSlash(sourceURL.Path)
err := copySourceStreamFromAlias(targetAlias, targetURL.String(), sourcePath, length, progress)
if err != nil {
cpURLs.Error = err.Trace(sourceURL.String())
return cpURLs
+2 -1
View File
@@ -246,7 +246,8 @@ func (ms *mirrorSession) doMirror(sURLs URLs) URLs {
if sourceAlias == targetAlias {
// If source/target are object storage their aliases must be the same
// Do not include alias inside path for ObjStore -> ObjStore.
err := copySourceStreamFromAlias(targetAlias, targetURL.String(), sourceURL.Path, length, ms.status)
sourcePath := filepath.ToSlash(sourceURL.Path)
err := copySourceStreamFromAlias(targetAlias, targetURL.String(), sourcePath, length, ms.status)
if err != nil {
return sURLs.WithError(err.Trace(sourceURL.String()))
}