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 { ...@@ -110,14 +110,15 @@ func Move(oldPath string, newPath string, out io.Writer) error {
if err != nil { if err != nil {
return err return err
} }
if inf.IsDir() || fn == "SHARDING" || fn == "_README" { if inf.IsDir() || fn == SHARDING_FN || fn == README_FN {
// if we are a director or generated file just remove it // we are an empty directory or generated file so just remove it
err := os.Remove(oldPath) err := os.Remove(oldPath)
if err != nil { if err != nil {
return err return err
} }
} else { } 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) newPath := filepath.Join(newDS.path, fn)
err := osrename.Rename(oldPath, newPath) err := osrename.Rename(oldPath, newPath)
if err != nil { 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