Merge pull request #13941 from hashicorp/jbardin/sigint-message
improve SIGINT output
This commit is contained in:
commit
58759b1167
|
@ -121,7 +121,7 @@ func (b *Local) opApply(
|
||||||
select {
|
select {
|
||||||
case <-ctx.Done():
|
case <-ctx.Done():
|
||||||
if b.CLI != nil {
|
if b.CLI != nil {
|
||||||
b.CLI.Output("Interrupt received. Gracefully shutting down...")
|
b.CLI.Output("stopping apply operation...")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Stop execution
|
// Stop execution
|
||||||
|
|
|
@ -201,7 +201,7 @@ func (c *ApplyCommand) Run(args []string) int {
|
||||||
ctxCancel()
|
ctxCancel()
|
||||||
|
|
||||||
// Notify the user
|
// Notify the user
|
||||||
c.Ui.Output("Interrupt received. Gracefully shutting down...")
|
c.Ui.Output(outputInterrupt)
|
||||||
|
|
||||||
// Still get the result, since there is still one
|
// Still get the result, since there is still one
|
||||||
select {
|
select {
|
||||||
|
@ -418,3 +418,7 @@ func outputsAsString(state *terraform.State, modPath []string, schema []*config.
|
||||||
|
|
||||||
return strings.TrimSpace(outputBuf.String())
|
return strings.TrimSpace(outputBuf.String())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const outputInterrupt = `Interrupt received.
|
||||||
|
Please wait for Terraform to exit or data loss may occur.
|
||||||
|
Gracefully shutting down...`
|
||||||
|
|
Loading…
Reference in New Issue