Browse Source

Merge pull request #4516 from gyuho/path

etcd-agent: ignore error when no file to rename
Gyu-Ho Lee 9 years ago
parent
commit
20ac633059
1 changed files with 9 additions and 2 deletions
  1. 9 2
      tools/functional-tester/etcd-agent/agent.go

+ 9 - 2
tools/functional-tester/etcd-agent/agent.go

@@ -194,7 +194,14 @@ func archiveLogAndDataDir(log string, datadir string) error {
 		return err
 		return err
 	}
 	}
 	if err := os.Rename(log, path.Join(dir, log)); err != nil {
 	if err := os.Rename(log, path.Join(dir, log)); err != nil {
-		return err
+		if !os.IsNotExist(err) {
+			return err
+		}
 	}
 	}
-	return os.Rename(datadir, path.Join(dir, datadir))
+	if err := os.Rename(datadir, path.Join(dir, datadir)); err != nil {
+		if !os.IsNotExist(err) {
+			return err
+		}
+	}
+	return nil
 }
 }