From 097a56fe01459a0038664ee4b254d2d30a5f0961 Mon Sep 17 00:00:00 2001 From: Yicheng Qin Date: Sat, 28 Mar 2015 18:22:43 -0700 Subject: [PATCH] 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. --- tools/functional-tester/etcd-agent/agent.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/functional-tester/etcd-agent/agent.go b/tools/functional-tester/etcd-agent/agent.go index d63143ce2..6aaac6042 100644 --- a/tools/functional-tester/etcd-agent/agent.go +++ b/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