Skip to content

Commit

Permalink
Merge pull request #1080 from zendesk/master
Browse files Browse the repository at this point in the history
Return every time lock acquisition fails
  • Loading branch information
armon committed Jul 22, 2015
2 parents 3e9e575 + f877b9e commit cfa7ed7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions command/lock.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,12 @@ func (c *LockCommand) Run(args []string) int {
c.Ui.Info("Attempting lock acquisition")
}
lockCh, err := lu.lockFn(c.ShutdownCh)
if err != nil || lockCh == nil {
c.Ui.Error(fmt.Sprintf("Lock acquisition failed: %s", err))
if lockCh == nil {
if err == nil {
c.Ui.Error("Shutdown triggered during lock acquisition")
} else {
c.Ui.Error(fmt.Sprintf("Lock acquisition failed: %s", err))
}
return 1
}

Expand Down

0 comments on commit cfa7ed7

Please sign in to comment.