Make sure we don't relock.

This commit is contained in:
Bruno Miguel Custodio 2017-09-08 16:22:14 +01:00
parent b8f4f6d3e2
commit bb4dec6032
No known key found for this signature in database
GPG Key ID: 84CDD9E18A1A6B2C
1 changed files with 3 additions and 0 deletions

View File

@ -100,6 +100,9 @@ func (c *RemoteClient) Lock(info *state.LockInfo) (string, error) {
if !c.DoLock {
return "", nil
}
if c.etcdSession != nil {
return "", fmt.Errorf("state %q already locked", c.Key)
}
c.info = info
return c.lock()