mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #4516 from gyuho/path
etcd-agent: ignore error when no file to rename
This commit is contained in:
commit
20ac633059
@ -194,7 +194,14 @@ func archiveLogAndDataDir(log string, datadir string) error {
|
||||
return err
|
||||
}
|
||||
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
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user