Merge pull request #1412 from krishnasrinivas/1404

detect invalid bucketname for mirror #1404
This commit is contained in:
Harshavardhana
2015-11-17 23:56:54 -08:00
+5
View File
@@ -90,6 +90,11 @@ func checkMirrorSyntax(ctx *cli.Context) {
fatalIf(errInvalidArgument().Trace(), fmt.Sprintf("Target ‘%s’ does not contain bucket name.", tgtURL))
}
}
_, _, err = url2Stat(tgtURL)
// we die on any error other than client.PathNotFound - destination directory need not exist.
if _, ok := err.ToGoError().(client.PathNotFound); !ok {
fatalIf(err.Trace(), fmt.Sprintf("Unable to stat %s", tgtURL))
}
}
}