From dfb44a2abef23626ea2d9352053e25beea2edce2 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 30 Aug 2013 16:39:28 -0700 Subject: [PATCH] packer/plugin: Interrupted() to check for i nterrupts --- packer/plugin/plugin.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packer/plugin/plugin.go b/packer/plugin/plugin.go index 48da97445..f9fca8cdd 100644 --- a/packer/plugin/plugin.go +++ b/packer/plugin/plugin.go @@ -177,3 +177,8 @@ func ServeProvisioner(p packer.Provisioner) { os.Exit(1) } } + +// Tests whether or not the plugin was interrupted or not. +func Interrupted() bool { + return atomic.LoadInt32(&Interrupts) > 0 +}