Просмотр исходного кода

tools/etcd-agent: stop etcd only if it is running

Stop etcd only if it is running, and not report error when stopping etcd
which is not started.
Yicheng Qin 11 лет назад
Родитель
Сommit
097a56fe01
1 измененных файлов с 3 добавлено и 0 удалено
  1. 3 0
      tools/functional-tester/etcd-agent/agent.go

+ 3 - 0
tools/functional-tester/etcd-agent/agent.go

@@ -73,6 +73,9 @@ func (a *Agent) start(args ...string) error {
 
 // stop stops the existing etcd process the agent started.
 func (a *Agent) stop() error {
+	if a.state != stateStarted {
+		return nil
+	}
 	err := a.cmd.Process.Kill()
 	if err != nil {
 		return err