浏览代码

better dir name

Yicheng Qin 10 年之前
父节点
当前提交
181ee445c1
共有 2 个文件被更改,包括 3 次插入3 次删除
  1. 2 2
      tools/functional-tester/etcd-agent/agent.go
  2. 1 1
      tools/functional-tester/etcd-agent/client/client.go

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

@@ -104,8 +104,8 @@ func (a *Agent) dataDir() string {
 }
 }
 
 
 func archiveLogAndDataDir(log string, datadir string) error {
 func archiveLogAndDataDir(log string, datadir string) error {
-	dir := fmt.Sprint(time.Now().Format(time.RFC3339))
-	if err := os.Mkdir(dir, 0700); err != nil {
+	dir := path.Join("failure_archive", fmt.Sprint(time.Now().Format(time.RFC3339)))
+	if err := os.MkdirAll(dir, 0700); err != nil {
 		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 {

+ 1 - 1
tools/functional-tester/etcd-agent/client/client.go

@@ -24,7 +24,7 @@ type Agent interface {
 	Stop() error
 	Stop() error
 	// Restart restarts the existing etcd the agent stopped.
 	// Restart restarts the existing etcd the agent stopped.
 	Restart() (int, error)
 	Restart() (int, error)
-	// Cleanup stops the exiting etcd the agent started and archived its data dir.
+	// Cleanup stops the exiting etcd the agent started, then archives log and its data dir.
 	Cleanup() error
 	Cleanup() error
 	// Terminate stops the exiting etcd the agent started and removes its data dir.
 	// Terminate stops the exiting etcd the agent started and removes its data dir.
 	Terminate() error
 	Terminate() error