etcdmain: use symlink instead of link for v0.4 files

link doesn't support directory.
This commit is contained in:
Yicheng Qin 2015-02-02 20:56:45 -08:00
parent afb14a3e7a
commit 92b329fdb9

View File

@ -360,7 +360,7 @@ func makeMemberDir(dir string) error {
// Link it to the subdir and keep the v1 file at the original
// location, so v0.4 etcd can still bootstrap if the upgrade
// failed.
if err := os.Link(path.Join(dir, name), path.Join(membdir, name)); err != nil {
if err := os.Symlink(path.Join(dir, name), path.Join(membdir, name)); err != nil {
return err
}
case v2Files.Contains(name):