Skip to content

Commit

Permalink
Merge pull request hashicorp#13941 from hashicorp/jbardin/sigint-message
Browse files Browse the repository at this point in the history
improve SIGINT output
  • Loading branch information
jbardin authored Apr 26, 2017
2 parents e06a376 + 7dad3f4 commit 58759b1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion backend/local/backend_apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func (b *Local) opApply(
select {
case <-ctx.Done():
if b.CLI != nil {
b.CLI.Output("Interrupt received. Gracefully shutting down...")
b.CLI.Output("stopping apply operation...")
}

// Stop execution
Expand Down
6 changes: 5 additions & 1 deletion command/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ func (c *ApplyCommand) Run(args []string) int {
ctxCancel()

// Notify the user
c.Ui.Output("Interrupt received. Gracefully shutting down...")
c.Ui.Output(outputInterrupt)

// Still get the result, since there is still one
select {
Expand Down Expand Up @@ -418,3 +418,7 @@ func outputsAsString(state *terraform.State, modPath []string, schema []*config.

return strings.TrimSpace(outputBuf.String())
}

const outputInterrupt = `Interrupt received.
Please wait for Terraform to exit or data loss may occur.
Gracefully shutting down...`

0 comments on commit 58759b1

Please sign in to comment.