summaryrefslogtreecommitdiff
path: root/lib/spack/spack/hooks/monitor.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/spack/spack/hooks/monitor.py')
-rw-r--r--lib/spack/spack/hooks/monitor.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/spack/spack/hooks/monitor.py b/lib/spack/spack/hooks/monitor.py
index 5ddc1223e8..9da5012593 100644
--- a/lib/spack/spack/hooks/monitor.py
+++ b/lib/spack/spack/hooks/monitor.py
@@ -41,6 +41,17 @@ def on_install_failure(spec):
tty.verbose(result.get('message'))
+def on_install_cancel(spec):
+ """Triggered on cancel of an install
+ """
+ if not spack.monitor.cli:
+ return
+
+ tty.debug("Running on_install_cancel for %s" % spec)
+ result = spack.monitor.cli.cancel_task(spec)
+ tty.verbose(result.get('message'))
+
+
def on_phase_success(pkg, phase_name, log_file):
"""Triggered on a phase success
"""