Commit 1eb10548 authored by Kevin Atkinson's avatar Kevin Atkinson

In Move function, output a warning when encountering an unexpected file.

parent 05f0240c
......@@ -110,14 +110,15 @@ func Move(oldPath string, newPath string, out io.Writer) error {
if err != nil {
return err
}
if inf.IsDir() || fn == "SHARDING" || fn == "_README" {
// if we are a director or generated file just remove it
if inf.IsDir() || fn == SHARDING_FN || fn == README_FN {
// we are an empty directory or generated file so just remove it
err := os.Remove(oldPath)
if err != nil {
return err
}
} else {
// else move it
// else we found something unexpected, so to be safe just move it
log.Warningf("found unexpected file in datastore directory: \"%s\", moving anyway", fn)
newPath := filepath.Join(newDS.path, fn)
err := osrename.Rename(oldPath, newPath)
if err != nil {
......
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