From 181ee445c1f717974795b2ef3e38a7c6776c516a Mon Sep 17 00:00:00 2001 From: Yicheng Qin Date: Thu, 5 Mar 2015 16:34:14 -0800 Subject: [PATCH] better dir name --- tools/functional-tester/etcd-agent/agent.go | 4 ++-- tools/functional-tester/etcd-agent/client/client.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/functional-tester/etcd-agent/agent.go b/tools/functional-tester/etcd-agent/agent.go index ee4c6b495..ecd39046a 100644 --- a/tools/functional-tester/etcd-agent/agent.go +++ b/tools/functional-tester/etcd-agent/agent.go @@ -104,8 +104,8 @@ func (a *Agent) dataDir() string { } 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 } if err := os.Rename(log, path.Join(dir, log)); err != nil { diff --git a/tools/functional-tester/etcd-agent/client/client.go b/tools/functional-tester/etcd-agent/client/client.go index 11704ec0a..58ffdc273 100644 --- a/tools/functional-tester/etcd-agent/client/client.go +++ b/tools/functional-tester/etcd-agent/client/client.go @@ -24,7 +24,7 @@ type Agent interface { Stop() error // Restart restarts the existing etcd the agent stopped. 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 // Terminate stops the exiting etcd the agent started and removes its data dir. Terminate() error