Merge pull request #3594 from yichengq/exit

etcdmain: exit after print out ErrDuplicateID
This commit is contained in:
Yicheng Qin 2015-09-25 14:28:45 -07:00
commit 93edabf85f

View File

@ -141,7 +141,6 @@ func Main() {
plog.Errorf("But etcd could not find valid cluster configuration in the given data dir (%s).", cfg.dir) plog.Errorf("But etcd could not find valid cluster configuration in the given data dir (%s).", cfg.dir)
plog.Infof("Please check the given data dir path if the previous bootstrap succeeded") plog.Infof("Please check the given data dir path if the previous bootstrap succeeded")
plog.Infof("or use a new discovery token if the previous bootstrap failed.") plog.Infof("or use a new discovery token if the previous bootstrap failed.")
os.Exit(1)
case discovery.ErrDuplicateName: case discovery.ErrDuplicateName:
plog.Errorf("member with duplicated name has registered with discovery service token(%s).", cfg.durl) plog.Errorf("member with duplicated name has registered with discovery service token(%s).", cfg.durl)
plog.Errorf("please check (cURL) the discovery token for more information.") plog.Errorf("please check (cURL) the discovery token for more information.")
@ -162,6 +161,7 @@ func Main() {
} }
plog.Fatalf("%v", err) plog.Fatalf("%v", err)
} }
os.Exit(1)
} }
osutil.HandleInterrupts() osutil.HandleInterrupts()